StatefulShellBranch constructor

StatefulShellBranch({
  1. required List<RouteBase> routes,
  2. GlobalKey<NavigatorState>? navigatorKey,
  3. String? initialLocation,
  4. String? restorationScopeId,
  5. List<NavigatorObserver>? observers,
  6. bool preload = false,
})

Constructs a StatefulShellBranch.

Implementation

StatefulShellBranch({
  required this.routes,
  GlobalKey<NavigatorState>? navigatorKey,
  this.initialLocation,
  this.restorationScopeId,
  this.observers,
  this.preload = false,
}) : navigatorKey = navigatorKey ?? GlobalKey<NavigatorState>() {
  assert(() {
    ShellRouteBase._debugCheckSubRouteParentNavigatorKeys(
        routes, this.navigatorKey);
    return true;
  }());
}