CanDeactivate class abstract

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

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 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