CupertinoApp constructor Null safety

const CupertinoApp(
  1. {Key? key,
  2. GlobalKey<NavigatorState>? navigatorKey,
  3. Widget? home,
  4. CupertinoThemeData? theme,
  5. Map<String, Widget Function(BuildContext)> routes = const <String, WidgetBuilder>{},
  6. String? initialRoute,
  7. RouteFactory? onGenerateRoute,
  8. InitialRouteListFactory? onGenerateInitialRoutes,
  9. RouteFactory? onUnknownRoute,
  10. List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
  11. TransitionBuilder? builder,
  12. String title = '',
  13. GenerateAppTitle? onGenerateTitle,
  14. Color? color,
  15. Locale? locale,
  16. Iterable<LocalizationsDelegate>? localizationsDelegates,
  17. LocaleListResolutionCallback? localeListResolutionCallback,
  18. LocaleResolutionCallback? localeResolutionCallback,
  19. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  20. bool showPerformanceOverlay = false,
  21. bool checkerboardRasterCacheImages = false,
  22. bool checkerboardOffscreenLayers = false,
  23. bool showSemanticsDebugger = false,
  24. bool debugShowCheckedModeBanner = true,
  25. Map<ShortcutActivator, Intent>? shortcuts,
  26. Map<Type, Action<Intent>>? actions,
  27. String? restorationScopeId,
  28. ScrollBehavior? scrollBehavior,
  29. bool useInheritedMediaQuery = false}
)

Creates a CupertinoApp.

At least one of home, routes, onGenerateRoute, or builder must be non-null. If only routes is given, it must include an entry for the Navigator.defaultRouteName (/), since that is the route used when the application is launched with an intent that specifies an otherwise unsupported route.

This class creates an instance of WidgetsApp.

The boolean arguments, routes, and navigatorObservers, must not be null.

Implementation

const CupertinoApp({
  super.key,
  this.navigatorKey,
  this.home,
  this.theme,
  Map<String, Widget Function(BuildContext)> this.routes = const <String, WidgetBuilder>{},
  this.initialRoute,
  this.onGenerateRoute,
  this.onGenerateInitialRoutes,
  this.onUnknownRoute,
  List<NavigatorObserver> this.navigatorObservers = const <NavigatorObserver>[],
  this.builder,
  this.title = '',
  this.onGenerateTitle,
  this.color,
  this.locale,
  this.localizationsDelegates,
  this.localeListResolutionCallback,
  this.localeResolutionCallback,
  this.supportedLocales = const <Locale>[Locale('en', 'US')],
  this.showPerformanceOverlay = false,
  this.checkerboardRasterCacheImages = false,
  this.checkerboardOffscreenLayers = false,
  this.showSemanticsDebugger = false,
  this.debugShowCheckedModeBanner = true,
  this.shortcuts,
  this.actions,
  this.restorationScopeId,
  this.scrollBehavior,
  this.useInheritedMediaQuery = false,
}) : assert(routes != null),
     assert(navigatorObservers != null),
     assert(title != null),
     assert(showPerformanceOverlay != null),
     assert(checkerboardRasterCacheImages != null),
     assert(checkerboardOffscreenLayers != null),
     assert(showSemanticsDebugger != null),
     assert(debugShowCheckedModeBanner != null),
     routeInformationProvider = null,
     routeInformationParser = null,
     routerDelegate = null,
     backButtonDispatcher = null,
     routerConfig = null;