If url has a trailing slash, remove it, otherwise return url as is.
Source
static String stripTrailingSlash(String url) { if (new RegExp(r'\/$').hasMatch(url)) { url = url.substring(0, url.length - 1); } return url; }
If url has a trailing slash, remove it, otherwise return url as is.
static String stripTrailingSlash(String url) { if (new RegExp(r'\/$').hasMatch(url)) { url = url.substring(0, url.length - 1); } return url; }