StatefulShellRoute.indexedStack constructor
StatefulShellRoute.indexedStack({
- required List<
StatefulShellBranch> branches, - bool notifyRootObserver = true,
- GoRouterRedirect? redirect,
- StatefulShellRouteBuilder? builder,
- StatefulShellRoutePageBuilder? pageBuilder,
- String? restorationScopeId,
- GlobalKey<
StatefulNavigationShellState> ? key,
Constructs a StatefulShellRoute that uses an IndexedStack for its nested Navigators.
This constructor provides an IndexedStack based implementation for the container (navigatorContainerBuilder) used to manage the Widgets representing the branch Navigators. Apart from that, this constructor works the same way as the default constructor.
See Stateful Nested Navigation for a complete runnable example using StatefulShellRoute.indexedStack.
Applications that rebuild their routing table using
GoRouter.routingConfig should provide and reuse key to preserve the
shell's page and branch navigator state.
Implementation
StatefulShellRoute.indexedStack({
required List<StatefulShellBranch> branches,
bool notifyRootObserver = true,
GoRouterRedirect? redirect,
StatefulShellRouteBuilder? builder,
GlobalKey<NavigatorState>? parentNavigatorKey,
StatefulShellRoutePageBuilder? pageBuilder,
String? restorationScopeId,
GlobalKey<StatefulNavigationShellState>? key,
}) : this(
branches: branches,
redirect: redirect,
builder: builder,
pageBuilder: pageBuilder,
notifyRootObserver: notifyRootObserver,
parentNavigatorKey: parentNavigatorKey,
restorationScopeId: restorationScopeId,
navigatorContainerBuilder: _indexedStackContainerBuilder,
key: key,
);