True when the route name matches pattern. * matches any text.
pattern
*
req.routeIs('users.*');
bool routeIs(String pattern) { String? name = route.name; return name != null && _wildcard(pattern).hasMatch(name); }