goTo method

void goTo(
  1. Screen<T> screen
)

Switches the current top screen to screen.

This is equivalent to a pop followed by a push.

Implementation

void goTo(Screen<T> screen) {
  var old = _screens.removeLast();
  old._unbind();

  screen._bind(this);
  _screens.add(screen);
  _render();
}