Defines route lifecycle method routerOnDeactivate, which is called by the router before destroying a component as part of a route change.

The routerOnDeactivate hook is called with two ComponentInstructions as parameters, the first representing the current route being navigated to, and the second parameter representing the previous route.

If routerOnDeactivate returns a Future, then the route change will wait until the Future completes.

Example

@override
void routerOnDeactivate(next, prev) {
  print('Deactivating ${prev.routeName} ${prev.urlPath}');
}

See the router documentation for details.

Constructors

OnDeactivate()

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

routerOnDeactivate(ComponentInstruction nextInstruction, ComponentInstruction prevInstruction) → dynamic
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 ==(other) → bool
The equality operator. [...]
inherited