CanDeactivate class

A lifecycle interface that allows conditionally deactivating a route.

Routed components should implement this to prevent deactivation based on the next RouterState. Prefer CanNavigate if the next RouterState isn't needed.

This interface is checked after constructing the components necessary to resolve the next RouterState.

An example use case is preventing deactivation if the current and next route haven't changed, but navigation was triggered for another reason such as an added query parameter.

Constructors

CanDeactivate()

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

canDeactivate(RouterState current, RouterState next) → Future<bool>
Called by the router when a transition is requested between router states. [...]
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