Removes trailing slash character from input url string.
String removeTrailingSlash(String uri) => uri.replaceAll(r'/\/$/', '');