ActivityStatefulShellRoute.indexedStack constructor

ActivityStatefulShellRoute.indexedStack({
  1. required List<ActivityShellBranch> branches,
  2. required Widget builder(
    1. BuildContext,
    2. ActivityRouteState,
    3. ActivityNavigationShell
    ),
  3. String? restorationScopeId,
  4. GlobalKey<NavigatorState>? parentNavigatorKey,
  5. ActivityRedirect? redirect,
})

Implementation

ActivityStatefulShellRoute.indexedStack({
  required List<ActivityShellBranch> branches,
  required this.builder,
  this.restorationScopeId,
  super.parentNavigatorKey,
  super.redirect,
}) : branches = List.unmodifiable(branches),
     super(routes: [for (final branch in branches) ...branch.routes]) {
  if (branches.isEmpty) {
    throw ArgumentError('A stateful shell needs branches');
  }
}