String cleanRoute(String route) { final result = route.replaceAll(RegExp(r'/+'), '/').replaceAll(RegExp(r'/$'), ''); return result.isEmpty ? '/' : result; }