routeIs method

bool routeIs(
  1. String pattern
)

True when the route name matches pattern. * matches any text.

req.routeIs('users.*');

Implementation

bool routeIs(String pattern) {
  String? name = route.name;
  return name != null && _wildcard(pattern).hasMatch(name);
}