NavigationResolver class

Represents a guarded navigation event which can be either continued or aborted used in AutoRouteGuard.onNavigation

Constructors

default constructor

Properties

context → BuildContext
returns the navigator context
no setter
future → Future<ResolverResult>
The future that will be completed by resolveNext
no setter
hashCode → int
The hash code for this object.
no setterinherited
isReevaluating → bool
Whether the navigation event is triggered by StackRouter.reevaluateGuards
no setter
isResolved → bool
Whether _completer is completed see Completer.isCompleted
no setter
pendingRoutes → List<RouteMatch>
If there are more that one route in the navigation even pending routes will be the routes that's waiting to be processed by guard
final
route → RouteMatch
The route being processing by the guard
final
routeName → String
Helper to get RouteMatch.name
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkGuard(AutoRouteGuard guard, StackRouter router) → Future<ResolverResult>
Checks the provided guard and waits for it to complete
next([bool continueNavigation = true]) → void
Completes _completer with either true to continue navigation or false to abort navigation
nextOrBack([bool continueNavigation = true]) → void
Helpful for when you want to revert to the previous url back can not navigate
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideNext({List<PageRouteInfo<Object?>>? children, Object? args, Map<String, dynamic>? queryParams, String? fragment, bool reevaluateNext = true}) → void
Overrides the current route with the provided values
redirect<T extends Object?>(PageRouteInfo<Object?> route, {OnNavigationFailure? onFailure, bool replace = false}) → Future<T?>
Keeps track of the navigated-to route To be auto-removed when completer is resolved
redirectUntil<T extends Object?>(PageRouteInfo<Object?> route, {OnNavigationFailure? onFailure, bool replace = false}) → Future<T?>
Temporary redirect to another route until the _completer is resolved
resolveNext(bool continueNavigation, {bool reevaluateNext = true}) → void
Completes _completer with either true to continue navigation or false to abort navigation
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited