GuestMiddleware class

Protects routes that should only be accessible to guests (e.g., Login, Register).

Inheritance

Constructors

GuestMiddleware({required bool isAuthenticated(), String homePath = '/'})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
homePath String
final
isAuthenticated bool Function()
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

handle(BuildContext context, GoRouterState state) FutureOr<String?>
Logic to decide if the navigation should be redirected. Returns a path to redirect to, or null to allow navigation.
override
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