NavigatorObserver class abstract
An interface for observing the behavior of a Navigator.
Subclass this and pass instances to Navigator.observers to receive callbacks when routes are pushed, popped, removed, or replaced.
class MyObserver extends NavigatorObserver {
@override
void didPush(Route route, Route? previousRoute) {
print('Pushed: ${route.settings.name}');
}
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
The navigator this observer is attached to.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
didPop(
Route route, Route? previousRoute) → void - Called when a route is popped from the navigator.
-
didPush(
Route route, Route? previousRoute) → void - Called when a route is pushed onto the navigator.
-
didRemove(
Route route, Route? previousRoute) → void - Called when a route is removed from the navigator.
-
didReplace(
{Route? newRoute, Route? oldRoute}) → void - Called when a route is replaced in the navigator.
-
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