pushReplacementNamed method

void pushReplacementNamed(
  1. String name
)

Pops the current route and places the route with name on top of the navigation stack.

If the route is already in the stack, it will simply be moved to the top. Otherwise the route will be mounted and added at the top. The route's page will also start building if it hasn't been built before. If the route is already on top of the stack, this method will do nothing.

This method calls the Route.didPush callback for the newly activated route and also calls the Route.didPop callback for the popped route.

Implementation

void pushReplacementNamed(String name) {
  pushNamed(name, replace: true);
}