pushReplacementOverlay method

void pushReplacementOverlay(
  1. String name
)

Pops the current route and puts the overlay route name on top of the navigation stack.

If name was already registered as a name of an overlay route, then this method is equivalent to pushNamed. If not, then a new OverlayRoute will be created based on the overlay with the same name within the root game.

Implementation

void pushReplacementOverlay(String name) {
  if (_routes.containsKey(name)) {
    assert(_routes[name] is OverlayRoute, '"$name" is not an overlay route');
    pushReplacementNamed(name);
  } else {
    pushReplacement(OverlayRoute.existing(), name: name);
  }
}