removeTrailingSlash function
Removes unncessary /
Implementation
String removeTrailingSlash(String serverUrl) {
if (serverUrl.isNotEmpty &&
serverUrl.substring(serverUrl.length - 1) == '/') {
return serverUrl.substring(0, serverUrl.length - 1);
} else {
return serverUrl;
}
}