RedirectRouteNodeGuard class
A guard that detects and breaks infinite redirect loops.
RedirectRouteNodeGuard counts how many times guards have redirected within a single mutation. When the counter reaches maxRedirects the guard delegates to onRedirect, which by default cancels the mutation.
- Implemented types
- Annotations
Constructors
- RedirectRouteNodeGuard({int maxRedirects = 5})
-
Creates a RedirectRouteNodeGuard with the given
maxRedirectslimit.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxRedirects → int
-
Maximum number of redirects allowed within a single mutation.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call(
RouteNode origin, RouteNode target, Map< String, Object> context) → GuardResult -
Invoked when the RouteNode state is about to change.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onRedirect(
RouteNode origin, RouteNode target, Map< String, Object> context, int redirectCount) → GuardResult - Invoked when the redirect counter reaches maxRedirects.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited