RouteGuard typedef
A synchronous or asynchronous check before a route is displayed.
Return allow to continue, deny to display the denied view, or redirect to replace the destination. Throw an exception to display the error/retry view.
Implementation
typedef RouteGuard = FutureOr<RouteDecision> Function(CurrentRoute route);