popToView method

  1. @override
void popToView(
  1. String routeIdentifier, [
  2. NavigationContext? navigationContext
])
override

Removes every navigation entry in the current stack until the route identified by routeIdentifier is found. A route is identified by a string if its url equals to the string (RemoteView) or if the screen id equals to the string (LocalView).

When the desired route is found, a navigation will be performed to this route. Otherwise, if the route isn't found in the current stack, an error is thrown.

Returns a Future that resolves as soon as the navigation completes.

Implementation

@override
void popToView(String routeIdentifier, [NavigationContext? navigationContext]) {
  _history.last.popToView(routeIdentifier, navigationContext);
}