Navigator constructor

const Navigator(
  1. {Key key,
  2. List<Page> pages: const >[],
  3. PopPageCallback onPopPage,
  4. String initialRoute,
  5. RouteListFactory onGenerateInitialRoutes: Navigator.defaultGenerateInitialRoutes,
  6. RouteFactory onGenerateRoute,
  7. RouteFactory onUnknownRoute,
  8. TransitionDelegate transitionDelegate: const DefaultTransitionDelegate(),
  9. List<NavigatorObserver> observers: const []}
)

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

The onGenerateRoute, pages, onGenerateInitialRoutes, transitionDelegate, observers arguments must not be null.

If the pages is not empty, the onPopPage must not be null.

Implementation

const Navigator({
  Key key,
  this.pages = const <Page<dynamic>>[],
  this.onPopPage,
  this.initialRoute,
  this.onGenerateInitialRoutes = Navigator.defaultGenerateInitialRoutes,
  this.onGenerateRoute,
  this.onUnknownRoute,
  this.transitionDelegate = const DefaultTransitionDelegate<dynamic>(),
  this.observers = const <NavigatorObserver>[],
}) : assert(pages != null),
     assert(onGenerateInitialRoutes != null),
     assert(transitionDelegate != null),
     assert(observers != null),
     super(key: key);