ShellRoute constructor Null safety

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) {
    if (route is GoRoute) {
      assert(route.parentNavigatorKey == null ||
          route.parentNavigatorKey == navigatorKey);
    }
  }
}