pos method

  1. @override
FutureOr<ParallelRoute?> pos(
  1. ModularRoute route,
  2. ModularArguments data
)
inherited

Method called as soon as route is found and after settings.

Implementation

@override
FutureOr<ParallelRoute?> pos(route, data) async {
  if (await canActivate(data.uri.toString(), route as ParallelRoute)) {
    return route;
  } else if (redirectTo != null) {
    return RedirectRoute(route.name, to: redirectTo!);
  }

  throw GuardedRouteException(route.uri.toString().trim());
}