ShellRoute constructor

ShellRoute({
  1. ShellRouteBuilder? builder,
  2. ShellRoutePageBuilder? pageBuilder,
  3. List<NavigatorObserver>? observers,
  4. required List<RouteBase> routes,
  5. GlobalKey<NavigatorState>? parentNavigatorKey,
  6. GlobalKey<NavigatorState>? navigatorKey,
  7. String? restorationScopeId,
})

Constructs a ShellRoute.

Implementation

ShellRoute({
  this.builder,
  this.pageBuilder,
  this.observers,
  required super.routes,
  super.parentNavigatorKey,
  GlobalKey<NavigatorState>? navigatorKey,
  this.restorationScopeId,
})  : assert(routes.isNotEmpty),
      navigatorKey = navigatorKey ?? GlobalKey<NavigatorState>(),
      super._() {
  assert(() {
    ShellRouteBase._debugCheckSubRouteParentNavigatorKeys(
        routes, this.navigatorKey);
    return true;
  }());
}