Defines route lifecycle method routerOnActivate, which is called by the router at the end of a successful route navigation.

For a single component's navigation, only one of either OnActivate or OnReuse will be called depending on the result of CanReuse.

The routerOnActivate 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 or null.

If routerOnActivate returns a promise, the route change will wait until the promise settles to instantiate and activate child components.

Example

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

See the router documentation for details.

Constructors

OnActivate()

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

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