String cleanPath(String url) { String cleanUrlPath = url; if (url.startsWith('/')) { cleanUrlPath = url.substring(1); } if (!url.endsWith('/')) { cleanUrlPath = '$url/'; } return cleanUrlPath; }