toAutoRouteGuardLocal<T extends PageRouteInfo<Object?>> method

AutoRouteGuard toAutoRouteGuardLocal<T extends PageRouteInfo<Object?>>(
  1. GuardedRouteGeneratingFunction<T> redirect
)

Converts your project's guard into an auto_route guard pretended to be used in the router's route definition, locally to that route.

Implementation

AutoRouteGuard toAutoRouteGuardLocal<T extends PageRouteInfo>(
  GuardedRouteGeneratingFunction<T> redirect,
) {
  return GuardsAutoRouteGuard(this, redirect);
  // return AutoRouteGuard.redirectPath(
  //   (navResolver) async {
  //     print('[${this.runtimeType}] isSatisfied: $checkIfSatisfied');
  //     if (await checkIfSatisfied) {
  //       // null means guard is satisfied and navigation should continue
  //       return null;
  //     } else {
  //       print('Redirecting to $guardIdentifier');
  //       return redirectPath;
  //     }
  //   },
  // );
}