A widget that manages a set of child widgets with a stack discipline.

Many apps have a navigator near the top of their widget hierarchy in order to display their logical history using an Overlay with the most recently visited pages visually on top of the older pages. Using this pattern lets the navigator visually transition from one page to another by the widgets around in the overlay. Similarly, the navigator can be used to show a dialog by positioning the dialog widget above the current page.

Inheritance

Constants

defaultRouteName String

The default name for the initial route.

'/'

Static Methods

canPop(BuildContext context) bool

Whether the navigator that most tightly encloses the given context can be popped.

of(BuildContext context) NavigatorState

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

pop(BuildContext context, [ result ]) bool

Pop a route off the navigator that most tightly encloses the given context.

popAndPushNamed(BuildContext context, String routeName, { result }) Future

Executes a simple transaction that both pops the current route off and pushes a named route into the navigator that most tightly encloses the given context.

popUntil(BuildContext context, RoutePredicate predicate) → void

Calls pop() repeatedly until the predicate returns true.

push(BuildContext context, Route route) Future

Push a route onto the navigator that most tightly encloses the given context.

pushNamed(BuildContext context, String routeName) Future

Push a named route onto the navigator that most tightly encloses the given context.

Constructors

Creates a widget that maintains a stack-based history of child widgets.

Properties

initialRoute String

The name of the first route to show.

read-only
observer NavigatorObserver

An observer for this navigator.

read-only
onGenerateRoute RouteFactory

Called to generate a route for a given RouteSettings.

read-only
onUnknownRoute RouteFactory

Called when onGenerateRoute fails to generate a route.

read-only
hashCode int

Get a hash code for this object.

read-only, inherited
key Key

Controls how one widget replaces another widget in the tree.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

createState() NavigatorState

Creates the mutable state for this widget at a given location in the tree.

createElement() StatefulElement

Creates a StatefulElement to manage this widget's location in the tree.

inherited
debugFillDescription(List<String> description) → void

Add additional information to the given description for use by toString.

inherited
noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() String

Returns a string representation of this object.

inherited
toStringShort() String

A short, textual description of this widget.

inherited