ShellRoute constructor

ShellRoute({
  1. ShellRouteBuilder? builder,
  2. ShellRoutePageBuilder? pageBuilder,
  3. List<RouteBase> routes = const <RouteBase>[],
  4. GlobalKey<NavigatorState>? navigatorKey,
})

Constructs a ShellRoute.

Implementation

ShellRoute({
  this.builder,
  this.pageBuilder,
  super.routes,
  GlobalKey<NavigatorState>? navigatorKey,
})  : assert(routes.isNotEmpty),
      navigatorKey = navigatorKey ?? GlobalKey<NavigatorState>(),
      super._() {
  for (final RouteBase route in routes) {
    assert(route is GoRoute);
    assert((route as GoRoute).parentNavigatorKey == null);
  }
}