addParametersToUrl function
Implementation
Uri addParametersToUrl(Uri url, Map<String, String>? parameters) {
if (parameters == null) return url;
String paramUrl = url.origin + url.path;
Map<String, String> newParameters = {};
url.queryParameters.forEach((key, value) {
newParameters[key] = value;
});
parameters.forEach((key, value) {
newParameters[key] = value;
});
return Uri.parse(buildUrlString(paramUrl, newParameters));
}