StatefulShellRoute.indexedStack constructor

StatefulShellRoute.indexedStack({
  1. required List<StatefulShellBranch> branches,
  2. GoRouterRedirect? redirect,
  3. StatefulShellRouteBuilder? builder,
  4. GlobalKey<NavigatorState>? parentNavigatorKey,
  5. StatefulShellRoutePageBuilder? pageBuilder,
  6. String? restorationScopeId,
  7. 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.

Implementation

StatefulShellRoute.indexedStack({
  required List<StatefulShellBranch> branches,
  GoRouterRedirect? redirect,
  StatefulShellRouteBuilder? builder,
  GlobalKey<NavigatorState>? parentNavigatorKey,
  StatefulShellRoutePageBuilder? pageBuilder,
  String? restorationScopeId,
  GlobalKey<StatefulNavigationShellState>? key,
}) : this(
        branches: branches,
        redirect: redirect,
        builder: builder,
        pageBuilder: pageBuilder,
        parentNavigatorKey: parentNavigatorKey,
        restorationScopeId: restorationScopeId,
        navigatorContainerBuilder: _indexedStackContainerBuilder,
        key: key,
      );