GuardContext class final

Immutable navigation snapshot passed to each Guard.

A new context is created for each evaluated destination, including redirected destinations in the same navigation flow.

Constructors

GuardContext({required HistoryLocation from, required HistoryLocation to, required HistoryAction action, required RouteParams params, required URLSearchParams query, required Map<String, Object?> meta, required Object? state})
Creates a guard context for a single navigation attempt.
const

Properties

action HistoryAction
The history action that triggered this evaluation.
final
from HistoryLocation
The last accepted location before this evaluation.
final
hashCode int
The hash code for this object.
no setterinherited
meta Map<String, Object?>
Merged route metadata for to.
final
params RouteParams
Route params resolved for to.
final
query URLSearchParams
Query params resolved for to.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state Object?
Candidate navigation state for to.
final
to HistoryLocation
The candidate destination currently being evaluated.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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