didRemove method
The Navigator removed route
.
If only one route is being removed, then the route immediately below
that one, if any, is previousRoute
.
If multiple routes are being removed, then the route below the
bottommost route being removed, if any, is previousRoute
, and this
method will be called once for each removed route, from the topmost route
to the bottommost route.
Implementation
@override
void didRemove(Route route, Route? previousRoute) {
developer.log(
'[PageNavigatorObserver][didReplace]route: ${PageInfo.convertPageName(route)}, pre: ${PageInfo.convertPageName(previousRoute)}',
name: debugLogType.pagePerformance);
int index = _pageStack
.indexWhere((pageInfo) => pageInfo.uniqueId == route.hashCode);
if (index < 0 || index >= _pageStack.length) {
return;
}
_pageStack.removeAt(index);
_handleNavigator(NavigatorType.remove);
}