AppState<T extends AppStatefulWidgetMVC> constructor

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