navigator property

NavigatorState get navigator

The state from the closest instance of this class that encloses the given context.

Typical usage is as follows:

context.navigator
  ..pop()
  ..pop()
  ..pushNamed('/settings');

If rootNavigator is set to true, the state from the furthest instance of this class is given instead. Useful for pushing contents above all subsequent instances of Navigator.

Implementation

NavigatorState get navigator {
  return Navigator.of(this);
}