Navigator constructor
- Key? key,
- List<
Page> pages = const <Page<dynamic>>[], - @Deprecated('Use onDidRemovePage instead. ' 'This feature was deprecated after v3.16.0-17.0.pre.') PopPageCallback? onPopPage,
- String? initialRoute,
- RouteListFactory onGenerateInitialRoutes = Navigator.defaultGenerateInitialRoutes,
- RouteFactory? onGenerateRoute,
- RouteFactory? onUnknownRoute,
- TransitionDelegate transitionDelegate = const DefaultTransitionDelegate<dynamic>(),
- bool reportsRouteUpdateToEngine = false,
- Clip clipBehavior = Clip.hardEdge,
- List<
NavigatorObserver> observers = const <NavigatorObserver>[], - bool requestFocus = true,
- String? restorationScopeId,
- TraversalEdgeBehavior routeTraversalEdgeBehavior = kDefaultRouteTraversalEdgeBehavior,
- DidRemovePageCallback? onDidRemovePage,
Creates a widget that maintains a stack-based history of child widgets.
Implementation
const Navigator({
super.key,
this.pages = const <Page<dynamic>>[],
@Deprecated(
'Use onDidRemovePage instead. '
'This feature was deprecated after v3.16.0-17.0.pre.',
)
this.onPopPage,
this.initialRoute,
this.onGenerateInitialRoutes = Navigator.defaultGenerateInitialRoutes,
this.onGenerateRoute,
this.onUnknownRoute,
this.transitionDelegate = const DefaultTransitionDelegate<dynamic>(),
this.reportsRouteUpdateToEngine = false,
this.clipBehavior = Clip.hardEdge,
this.observers = const <NavigatorObserver>[],
this.requestFocus = true,
this.restorationScopeId,
this.routeTraversalEdgeBehavior = kDefaultRouteTraversalEdgeBehavior,
this.onDidRemovePage,
});