AppState<T extends StatefulWidget> constructor

AppState<T extends StatefulWidget>({
  1. Key? key,
  2. Widget? home,
  3. AppController? controller,
  4. List<StateXController>? controllers,
  5. void binding()?,
  6. List<Function>? bindings,
  7. Object? object,
  8. MaterialApp? materialApp,
  9. CupertinoApp? cupertinoApp,
  10. @Deprecated('No longer available to the user.') GlobalKey<NavigatorState>? navigatorKey,
  11. RouteInformationProvider? routeInformationProvider,
  12. RouteInformationParser<Object>? routeInformationParser,
  13. RouterDelegate<Object>? routerDelegate,
  14. RouterConfig<Object>? routerConfig,
  15. BackButtonDispatcher? backButtonDispatcher,
  16. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  17. Map<String, WidgetBuilder>? routes,
  18. String? initialRoute,
  19. RouteFactory? onGenerateRoute,
  20. RouteFactory? onUnknownRoute,
  21. List<NavigatorObserver>? navigatorObservers,
  22. TransitionBuilder? builder,
  23. String? title,
  24. GenerateAppTitle? onGenerateTitle,
  25. ThemeData? theme,
  26. CupertinoThemeData? iOSTheme,
  27. ThemeData? darkTheme,
  28. ThemeMode? themeMode,
  29. Color? color,
  30. Locale? locale,
  31. Iterable<LocalizationsDelegate>? localizationsDelegates,
  32. LocaleListResolutionCallback? localeListResolutionCallback,
  33. LocaleResolutionCallback? localeResolutionCallback,
  34. List<Locale>? supportedLocales,
  35. bool? useMaterial,
  36. bool? useCupertino,
  37. bool? switchUI,
  38. bool? debugShowMaterialGrid,
  39. bool? showPerformanceOverlay,
  40. bool? checkerboardRasterCacheImages,
  41. bool? checkerboardOffscreenLayers,
  42. bool? showSemanticsDebugger,
  43. bool? debugShowCheckedModeBanner,
  44. Map<LogicalKeySet, Intent>? shortcuts,
  45. Map<Type, Action<Intent>>? actions,
  46. CustomTransition? customTransition,
  47. Map<String, Map<String, String>>? translationsKeys,
  48. Translations? translations,
  49. TextDirection? textDirection,
  50. Locale? fallbackLocale,
  51. ValueChanged<Routing?>? routingCallback,
  52. Transition? defaultTransition,
  53. bool? opaqueRoute,
  54. VoidCallback? onInit,
  55. VoidCallback? onReady,
  56. VoidCallback? onDispose,
  57. bool? enableLog,
  58. LogWriterCallback? logWriterCallback,
  59. bool? popGesture,
  60. SmartManagement? smartManagement,
  61. Bindings? initialBinding,
  62. Duration? transitionDuration,
  63. bool? defaultGlobalState,
  64. List<GetPage>? getPages,
  65. bool? useRouter,
  66. GetPage? unknownRoute,
  67. ScrollBehavior? scrollBehavior,
  68. bool? useInheritedMediaQuery,
  69. bool? debugShowWidgetInspector,
  70. bool? debugPaintSizeEnabled,
  71. bool? debugPaintBaselinesEnabled,
  72. bool? debugPaintPointersEnabled,
  73. bool? debugPaintLayerBordersEnabled,
  74. bool? debugRepaintRainbowEnabled,
  75. bool? debugRepaintTextRainbowEnabled,
  76. FlutterExceptionHandler? errorHandler,
  77. ErrorWidgetBuilder? errorScreen,
  78. ReportErrorHandler? errorReport,
  79. FlutterExceptionHandler? inErrorHandler,
  80. ErrorWidgetBuilder? inErrorScreen,
  81. Future<void> inErrorReport(
    1. Object exception,
    2. StackTrace stack
    )?,
  82. void inInitState()?,
  83. Future<bool> inInitAsync()?,
  84. void inBinding()?,
  85. Widget inHome()?,
  86. RouteInformationProvider inRouteInformationProvider()?,
  87. RouteInformationParser<Object> inRouteInformationParser()?,
  88. RouterDelegate<Object> inRouterDelegate()?,
  89. RouterConfig<Object>? inRouterConfig()?,
  90. BackButtonDispatcher inBackButtonDispatcher()?,
  91. Map<String, WidgetBuilder> inRoutes()?,
  92. String inInitialRoute()?,
  93. RouteFactory inOnGenerateRoute()?,
  94. RouteFactory inOnUnknownRoute()?,
  95. List<NavigatorObserver> inNavigatorObservers()?,
  96. TransitionBuilder inTransBuilder()?,
  97. String inTitle()?,
  98. GenerateAppTitle? inGenerateTitle,
  99. ThemeData? inTheme()?,
  100. CupertinoThemeData? iniOSTheme()?,
  101. ThemeData? inDarkTheme()?,
  102. ThemeMode? inThemeMode()?,
  103. Color? inColor()?,
  104. Locale? inLocale()?,
  105. Iterable<LocalizationsDelegate> inLocalizationsDelegates()?,
  106. LocaleListResolutionCallback? inLocaleListResolutionCallback,
  107. LocaleResolutionCallback? inLocaleResolutionCallback,
  108. List<Locale>? inSupportedLocales()?,
  109. bool? inDebugShowMaterialGrid()?,
  110. bool? inShowPerformanceOverlay()?,
  111. bool? inCheckerboardRasterCacheImages()?,
  112. bool? inCheckerboardOffscreenLayers()?,
  113. bool? inShowSemanticsDebugger()?,
  114. bool? inDebugShowCheckedModeBanner()?,
  115. Map<LogicalKeySet, Intent>? inShortcuts()?,
  116. Map<Type, Action<Intent>>? inActions()?,
  117. String? inRestorationScopeId()?,
  118. ScrollBehavior? inScrollBehavior()?,
  119. bool? inInheritedMediaQuery()?,
  120. void inError(
    1. FlutterErrorDetails details
    )?,
  121. 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,
  this.binding,
  this.bindings,
  super.object,
  super.materialApp,
  super.cupertinoApp,
  @Deprecated('No longer available to the user.') 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.customTransition,
  super.translationsKeys,
  super.translations,
  super.textDirection,
  super.fallbackLocale,
  super.routingCallback,
  super.defaultTransition,
  super.opaqueRoute,
  super.onInit,
  super.onReady,
  super.onDispose,
  super.enableLog,
  super.logWriterCallback,
  super.popGesture,
  super.smartManagement,
  super.initialBinding,
  super.transitionDuration,
  super.defaultGlobalState,
  super.getPages,
  this.useRouter,
  super.unknownRoute,
//    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,
  super.inErrorHandler,
  super.inErrorScreen,
  super.inErrorReport,
  this.inInitState,
  this.inInitAsync,
  this.inBinding,
  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,
})  : _stateRouteObserver = StateRouteObserver(),
      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;
}