GuardResult class

The result returned by a BloomGuard when evaluating navigation access.

Determines whether the navigation should proceed (allow), redirect to a different route (redirect), or be denied with an error (deny).

Example:

if (!isAuthenticated) {
  return GuardResult.redirect('/login');
}
return GuardResult.allow();

Constructors

GuardResult.allow()
Allows navigation to proceed to the target route.
factory
GuardResult.deny([String? message])
Denies navigation with an optional explanation message.
factory
GuardResult.redirect(String path)
Redirects navigation to a different path.
factory

Properties

denialMessage → String?
Optional explanation message when access is denied.
final
hashCode → int
The hash code for this object.
no setterinherited
isAllowed → bool
Whether navigation to the requested route is permitted.
final
redirectPath → String?
Target redirect route path if navigation is not allowed.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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