GuardConfiguration class

A composite RouteNodeGuard that runs a pipeline of guards in order.

GuardConfiguration wires together a list of guards, an optional RedirectRouteNodeGuard that runs first to guard against redirect loops, and an optional GuardObserver that receives lifecycle events. The pipeline stops as soon as a guard returns GuardResultCancel, and restarts against the new target when a guard returns GuardResultRedirect.

Implemented types

Constructors

GuardConfiguration({Iterable<RouteNodeGuard> guards = const <RouteNodeGuard>[], RedirectRouteNodeGuard? redirectGuard, GuardObserver? observer})
A composite RouteNodeGuard that runs a pipeline of guards in order.
const

Properties

guards → Iterable<RouteNodeGuard>
The effective list of guards to run, in order.
no setter
hashCode → int
The hash code for this object.
no setterinherited
observer → GuardObserver?
Observer that receives guard pipeline events.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(RouteNode origin, RouteNode target, GuardContext 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
onGuards(RouteNode origin, RouteNode target, GuardContext context, RouteNode? redirect) → GuardResult
toString() → String
A string representation of this object.
inherited

Operators

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