paramsConverter function
Implementation
String paramsConverter(
{required String path, required Map<String, String?> params}) {
List<String> paths = path
.split("/")
.where((element) => element != "" && element[0] == ":")
.toList();
for (var param in paths) {
path =
path.replaceFirst(param, params[param.replaceFirst(":", "")] ?? param);
}
return path;
}