CupertinoApp constructor

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. NotificationListenerCallback<NavigationNotification>? onNavigationNotification,
  11. List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
  12. TransitionBuilder? builder,
  13. String title = '',
  14. GenerateAppTitle? onGenerateTitle,
  15. Color? color,
  16. Locale? locale,
  17. Iterable<LocalizationsDelegate>? localizationsDelegates,
  18. LocaleListResolutionCallback? localeListResolutionCallback,
  19. LocaleResolutionCallback? localeResolutionCallback,
  20. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  21. bool showPerformanceOverlay = false,
  22. bool checkerboardRasterCacheImages = false,
  23. bool checkerboardOffscreenLayers = false,
  24. bool showSemanticsDebugger = false,
  25. bool debugShowCheckedModeBanner = true,
  26. Map<ShortcutActivator, Intent>? shortcuts,
  27. Map<Type, Action<Intent>>? actions,
  28. String? restorationScopeId,
  29. ScrollBehavior? scrollBehavior,
  30. @Deprecated('Remove this parameter as it is now ignored. ' 'CupertinoApp never introduces its own MediaQuery; the View widget takes care of that. ' 'This feature was deprecated after v3.7.0-29.0.pre.') 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.

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,
  this.onNavigationNotification,
  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,
  @Deprecated(
    'Remove this parameter as it is now ignored. '
    'CupertinoApp never introduces its own MediaQuery; the View widget takes care of that. '
    'This feature was deprecated after v3.7.0-29.0.pre.'
  )
  this.useInheritedMediaQuery = false,
}) : routeInformationProvider = null,
     routeInformationParser = null,
     routerDelegate = null,
     backButtonDispatcher = null,
     routerConfig = null;