RouteInterceptor class
Tracks navigation history and the current route stack, feeding the
Routes tab. Register instance as a MaterialApp.navigatorObservers
entry.
- Inheritance
-
- Object
- NavigatorObserver
- RouteObserver<
PageRoute> - RouteInterceptor
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
The navigator that the observer is observing, if any.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
debugObservingRoute(
PageRoute route) → bool -
Whether this observer is managing changes for the specified route.
inherited
-
didChangeTop(
Route topRoute, Route? previousTopRoute) → void -
The top most route has changed.
inherited
-
didPop(
Route route, Route? previousRoute) → void -
The Navigator popped
route.override -
didPush(
Route route, Route? previousRoute) → void -
The Navigator pushed
route.override -
didRemove(
Route route, Route? previousRoute) → void -
The Navigator removed
route.inherited -
didReplace(
{Route? newRoute, Route? oldRoute}) → void -
The Navigator replaced
oldRoutewithnewRoute.override -
didStartUserGesture(
Route route, Route? previousRoute) → void -
The Navigator's routes are being moved by a user gesture.
inherited
-
didStopUserGesture(
) → void -
User gesture is no longer controlling the Navigator.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subscribe(
RouteAware routeAware, PageRoute route) → void -
Subscribe
routeAwareto be informed about changes toroute.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribe(
RouteAware routeAware) → void -
Unsubscribe
routeAware.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
entryTimestamps
→ Map<
String, DateTime> -
Entry time per route name. If the same route is on the stack more than
once, the most recent entry wins.
no setter
-
instance
→ RouteObserver<
PageRoute> -
The singleton observer instance to pass to
MaterialApp.navigatorObservers.no setter -
routeArguments
→ Map<
String, dynamic> -
Route arguments by route name, from the most recent push/replace of
that name.
final
-
routeHistory
→ List<
String> -
A running log of push/pop/replace events, newest-appended, capped at
1000 entries.
no setter
-
routeStack
→ List<
String> -
Names of routes currently on the navigator stack, oldest first. A name
appears once per time it's on the stack, so A → B → A lists
[A, B, A].no setter -
routeVersion
→ ValueNotifier<
int> -
Bumped on every navigation event and clear, so the Routes tab can
rebuild.
final
Static Methods
-
clear(
) → void - Clears the recorded history. Routes still on the navigator stack are left alone — they are live state, not history, and dropping them would break duration tracking for screens the user still has open.
-
init(
) → void -
Logs a one-time initialization notice. Called once by
FlutterDevToolkit.init.