MacosApp constructor

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

Creates a MacosApp.

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 CupertinoApp.

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

Implementation

const MacosApp({
  super.key,
  this.navigatorKey,
  this.home,
  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 = const MacosScrollBehavior(),
  this.themeMode,
  this.theme,
  this.darkTheme,
})  : routeInformationProvider = null,
      routeInformationParser = null,
      routerDelegate = null,
      backButtonDispatcher = null,
      routerConfig = null;