pushOverlay method

void pushOverlay(
  1. String name
)

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 pushOverlay(String name) {
  if (_routes.containsKey(name)) {
    assert(_routes[name] is OverlayRoute, '"$name" is not an overlay route');
    pushNamed(name);
  } else {
    pushRoute(OverlayRoute.existing(), name: name);
  }
}