generatePath method
Generates a path from a named route with params.
Implementation
String? generatePath(String name, [Map<String, String>? params]) {
final route = findByName(name);
if (route == null) return null;
var path = route.path;
params?.forEach((key, value) {
path = path.replaceAll(':$key', value);
});
return path;
}