didReplace method
The Navigator replaced oldRoute
with newRoute
.
Implementation
@override
void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) {
int oldRouteIndex = _history.indexOf(oldRoute);
_history.replaceRange(oldRouteIndex, oldRouteIndex + 1, [newRoute]);
_historyChangeStreamController.add(HistoryChange(
action: NavigationStackAction.replace,
newRoute: newRoute,
oldRoute: oldRoute,
));
}