CanNavigate class

A lifecycle interface that allows conditionally preventing navigation.

Routed components should implement this to prevent navigation regardless of the next RouterState. This interface is preferable to CanDeactivate, which can be used if the next RouterState is necessary.

This interface is checked immediately upon navigation, before constructing the components necessary to resolve the next RouterState.

An example use case is preventing navigation if a form has unsaved changes.

Constructors

CanNavigate()

Properties

hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

canNavigate() → Future<bool>
Called by the router upon navigation. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited