popAndPush<T extends Object?, TO extends Object?> method
Future<T?>
popAndPush<T extends Object?, TO extends Object?>(
- PageRouteInfo route, {
- TO? result,
- OnNavigationFailure? onFailure,
Pop the current route off the navigator and push the given route
in its place.
if onFailure
callback is provided, navigation errors will be passed to it
otherwise they'll be thrown
Implementation
@optionalTypeArgs
Future<T?> popAndPush<T extends Object?, TO extends Object?>(
PageRouteInfo route, {
TO? result,
OnNavigationFailure? onFailure,
}) {
final scope = _findStackScope(route);
scope.maybePop<TO>(result);
return scope._push<T>(route, onFailure: onFailure);
}