didReplace method
The Navigator replaced oldRoute
with newRoute
.
Implementation
@override
void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) {
super.didReplace(newRoute: newRoute, oldRoute: oldRoute);
if (newRoute is PageRoute && oldRoute is PageRoute) {
if (newRoute.settings is MaterialPage ||
newRoute.settings is CustomTransitionPage) {
var goRoute = newRoute.settings;
var goPreviousRoute = oldRoute.settings;
_addGoRouterBreadcrumb('didReplace', goPreviousRoute, goRoute);
} else {
_addBreadcrumb('didReplace', oldRoute.settings, newRoute.settings);
}
}
}