StatefulShellRoute.indexedStack constructor

StatefulShellRoute.indexedStack({
  1. required List<StatefulShellBranch> branches,
  2. StatefulShellRouteBuilder? builder,
  3. GlobalKey<NavigatorState>? parentNavigatorKey,
  4. StatefulShellRoutePageBuilder? pageBuilder,
  5. String? restorationScopeId,
})

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,
  StatefulShellRouteBuilder? builder,
  GlobalKey<NavigatorState>? parentNavigatorKey,
  StatefulShellRoutePageBuilder? pageBuilder,
  String? restorationScopeId,
}) : this(
        branches: branches,
        builder: builder,
        pageBuilder: pageBuilder,
        parentNavigatorKey: parentNavigatorKey,
        restorationScopeId: restorationScopeId,
        navigatorContainerBuilder: _indexedStackContainerBuilder,
      );