AppState<T extends StatefulWidget> constructor

AppState<T extends StatefulWidget>({
  1. Key? key,
  2. Widget? home,
  3. AppController? controller,
  4. List<StateXController>? controllers,
  5. Object? object,
  6. MaterialApp? materialApp,
  7. CupertinoApp? cupertinoApp,
  8. GlobalKey<NavigatorState>? navigatorKey,
  9. RouteInformationProvider? routeInformationProvider,
  10. RouteInformationParser<Object>? routeInformationParser,
  11. RouterDelegate<Object>? routerDelegate,
  12. RouterConfig<Object>? routerConfig,
  13. BackButtonDispatcher? backButtonDispatcher,
  14. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  15. Map<String, WidgetBuilder>? routes,
  16. String? initialRoute,
  17. RouteFactory? onGenerateRoute,
  18. RouteFactory? onUnknownRoute,
  19. List<NavigatorObserver>? navigatorObservers,
  20. TransitionBuilder? builder,
  21. String? title,
  22. GenerateAppTitle? onGenerateTitle,
  23. ThemeData? theme,
  24. CupertinoThemeData? iOSTheme,
  25. ThemeData? darkTheme,
  26. ThemeMode? themeMode,
  27. Color? color,
  28. Locale? locale,
  29. Iterable<LocalizationsDelegate>? localizationsDelegates,
  30. LocaleListResolutionCallback? localeListResolutionCallback,
  31. LocaleResolutionCallback? localeResolutionCallback,
  32. List<Locale>? supportedLocales,
  33. bool? useMaterial,
  34. bool? useCupertino,
  35. bool? switchUI,
  36. bool? debugShowMaterialGrid,
  37. bool? showPerformanceOverlay,
  38. bool? checkerboardRasterCacheImages,
  39. bool? checkerboardOffscreenLayers,
  40. bool? showSemanticsDebugger,
  41. bool? debugShowCheckedModeBanner,
  42. Map<LogicalKeySet, Intent>? shortcuts,
  43. Map<Type, Action<Intent>>? actions,
  44. String? restorationScopeId,
  45. ScrollBehavior? scrollBehavior,
  46. bool? useInheritedMediaQuery,
  47. bool? debugShowWidgetInspector,
  48. bool? debugPaintSizeEnabled,
  49. bool? debugPaintBaselinesEnabled,
  50. bool? debugPaintPointersEnabled,
  51. bool? debugPaintLayerBordersEnabled,
  52. bool? debugRepaintRainbowEnabled,
  53. bool? debugRepaintTextRainbowEnabled,
  54. FlutterExceptionHandler? errorHandler,
  55. ErrorWidgetBuilder? errorScreen,
  56. ReportErrorHandler? errorReport,
  57. void inInitState()?,
  58. Future<bool> inInitAsync()?,
  59. Widget inHome()?,
  60. RouteInformationProvider inRouteInformationProvider()?,
  61. RouteInformationParser<Object> inRouteInformationParser()?,
  62. RouterDelegate<Object> inRouterDelegate()?,
  63. RouterConfig<Object>? inRouterConfig()?,
  64. BackButtonDispatcher inBackButtonDispatcher()?,
  65. Map<String, WidgetBuilder> inRoutes()?,
  66. String inInitialRoute()?,
  67. RouteFactory inOnGenerateRoute()?,
  68. RouteFactory inOnUnknownRoute()?,
  69. List<NavigatorObserver> inNavigatorObservers()?,
  70. TransitionBuilder inTransBuilder()?,
  71. String inTitle()?,
  72. GenerateAppTitle? inGenerateTitle,
  73. ThemeData? inTheme()?,
  74. CupertinoThemeData? iniOSTheme()?,
  75. ThemeData? inDarkTheme()?,
  76. ThemeMode? inThemeMode()?,
  77. Color? inColor()?,
  78. Locale? inLocale()?,
  79. Iterable<LocalizationsDelegate> inLocalizationsDelegates()?,
  80. LocaleListResolutionCallback? inLocaleListResolutionCallback,
  81. LocaleResolutionCallback? inLocaleResolutionCallback,
  82. List<Locale>? inSupportedLocales()?,
  83. bool? inDebugShowMaterialGrid()?,
  84. bool? inShowPerformanceOverlay()?,
  85. bool? inCheckerboardRasterCacheImages()?,
  86. bool? inCheckerboardOffscreenLayers()?,
  87. bool? inShowSemanticsDebugger()?,
  88. bool? inDebugShowCheckedModeBanner()?,
  89. Map<LogicalKeySet, Intent>? inShortcuts()?,
  90. Map<Type, Action<Intent>>? inActions()?,
  91. String? inRestorationScopeId()?,
  92. ScrollBehavior? inScrollBehavior()?,
  93. bool? inInheritedMediaQuery()?,
  94. void inError(
    1. FlutterErrorDetails details
    )?,
  95. bool? inAsyncError(
    1. FlutterErrorDetails details
    )?,
})

Provide a huge array of options and features to the 'App State object.'

Implementation

AppState({
  this.key,
  this.home,
  AppController? controller,
  super.controllers,
  super.object,
  super.materialApp,
  super.cupertinoApp,
  super.navigatorKey,
  super.routeInformationProvider,
  super.routeInformationParser,
  super.routerDelegate,
  super.routerConfig,
  super.backButtonDispatcher,
  super.scaffoldMessengerKey,
  super.routes,
  super.initialRoute,
  super.onGenerateRoute,
  super.onUnknownRoute,
  super.navigatorObservers,
  super.builder,
  super.title,
  super.onGenerateTitle,
  super.theme,
  super.iOSTheme,
  super.darkTheme,
  super.themeMode,
  super.color,
  super.locale,
  super.localizationsDelegates,
  super.localeListResolutionCallback,
  super.localeResolutionCallback,
  super.supportedLocales,
  this.useMaterial,
  this.useCupertino,
  this.switchUI,
  super.debugShowMaterialGrid,
  super.showPerformanceOverlay,
  super.checkerboardRasterCacheImages,
  super.checkerboardOffscreenLayers,
  super.showSemanticsDebugger,
  super.debugShowCheckedModeBanner,
  super.shortcuts,
  super.actions,
  super.restorationScopeId,
  super.scrollBehavior,
  super.useInheritedMediaQuery,
  super.debugShowWidgetInspector,
  super.debugPaintSizeEnabled,
  super.debugPaintBaselinesEnabled,
  super.debugPaintPointersEnabled,
  super.debugPaintLayerBordersEnabled,
  super.debugRepaintRainbowEnabled,
  super.debugRepaintTextRainbowEnabled,
  super.errorHandler,
  super.errorScreen,
  super.errorReport,
  this.inInitState,
  this.inInitAsync,
  this.inHome,
  this.inRouteInformationProvider,
  this.inRouteInformationParser,
  this.inRouterDelegate,
  this.inRouterConfig,
  this.inBackButtonDispatcher,
  this.inRoutes,
  this.inInitialRoute,
  this.inOnGenerateRoute,
  this.inOnUnknownRoute,
  this.inNavigatorObservers,
  this.inTransBuilder,
  this.inTitle,
  this.inGenerateTitle,
  this.inTheme,
  this.iniOSTheme,
  this.inDarkTheme,
  this.inThemeMode,
  this.inColor,
  this.inLocale,
  this.inLocalizationsDelegates,
  this.inLocaleListResolutionCallback,
  this.inLocaleResolutionCallback,
  this.inSupportedLocales,
  this.inDebugShowMaterialGrid,
  this.inShowPerformanceOverlay,
  this.inCheckerboardRasterCacheImages,
  this.inCheckerboardOffscreenLayers,
  this.inShowSemanticsDebugger,
  this.inDebugShowCheckedModeBanner,
  this.inShortcuts,
  this.inActions,
  this.inRestorationScopeId,
  this.inScrollBehavior,
  this.inInheritedMediaQuery,
  this.inError,
  this.inAsyncError,
}) : super(controller: controller ?? AppController()) {
  // In case null was explicitly passed in.
  useMaterial ??= false;
  useCupertino ??= false;
  switchUI ??= false;

  if (UniversalPlatform.isAndroid) {
    if (switchUI!) {
      useMaterial = false;
      useCupertino = true;
    } else if (useCupertino!) {
      useMaterial = false;
    } else {
      useMaterial = true;
      useCupertino = false;
    }
  } else if (UniversalPlatform.isIOS) {
    if (switchUI!) {
      useMaterial = true;
      useCupertino = false;
    } else if (useMaterial!) {
      useCupertino = false;
    } else {
      useMaterial = false;
      useCupertino = true;
    }
  } else {
    useMaterial = true;
    useCupertino = false;
  }

  // These ones can't be changed.
  _isMaterial = useMaterial;
  _isCupertino = useCupertino;
}