CanNavigate class abstract

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.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canNavigate() Future<bool>
Called by the router upon navigation.
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