pushReplacement<T, TO> method
Pushes a route and removes the current top route.
The result is used to complete the previous route's future.
Implementation
Future<T?> pushReplacement<T, TO>(Route<T> route, {TO? result}) {
// Pop the current route first (without triggering rebuild yet).
if (_routes.isNotEmpty) {
_removeTopRoute(result: result);
}
return push<T>(route);
}