handlesRoute method

bool handlesRoute(
  1. String route, {
  2. bool calculate = false,
})

Whether this router handles the defined route

Implementation

bool handlesRoute(String route, {bool calculate = false}) {
  final foundRoute = _routeTree.findRouteByKey(route);
  if (foundRoute != null ||
      !calculate ||
      (route.contains('{') && route.contains('}'))) {
    return foundRoute != null;
  }

  return _routeTree.matchRoute(route) != null;
}