toRoutePath function
Converts the string title to route path.
Implementation
String toRoutePath({required String title}) {
String routePath;
String string = getStringFromTextWidget(title);
string = string.replaceAll(RegExp(r'[^\w\s]+'), '').toLowerCase();
string.contains(' ')
? routePath = string.replaceAll(" ", "-")
: routePath = string;
return "/$routePath";
}