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. RouteInformationProvider? routeInformationProvider,
  9. RouteInformationParser<Object>? routeInformationParser,
  10. RouterDelegate<Object>? routerDelegate,
  11. bool? useRouterConfig,
  12. RouterConfig<Object>? routerConfig,
  13. BackButtonDispatcher? backButtonDispatcher,
  14. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  15. Map<String, WidgetBuilder>? routes,
  16. String? initialRoute,
  17. Route? onGenerateRoute(
    1. RouteSettings settings
    )?,
  18. Route? onUnknownRoute(
    1. RouteSettings settings
    )?,
  19. bool onNavigationNotification(
    1. NavigationNotification notification
    )?,
  20. List<NavigatorObserver>? navigatorObservers,
  21. TransitionBuilder? builder,
  22. String? title,
  23. String onGenerateTitle(
    1. BuildContext context
    )?,
  24. Color? color,
  25. bool? allowChangeTheme,
  26. ThemeData? theme,
  27. CupertinoThemeData? iOSTheme,
  28. ThemeData? darkTheme,
  29. ThemeData? highContrastTheme,
  30. ThemeData? highContrastDarkTheme,
  31. ThemeMode? themeMode,
  32. Duration? themeAnimationDuration,
  33. Curve? themeAnimationCurve,
  34. bool? allowChangeLocale,
  35. Locale? locale,
  36. Iterable<LocalizationsDelegate>? localizationsDelegates,
  37. LocaleListResolutionCallback? localeListResolutionCallback,
  38. LocaleResolutionCallback? localeResolutionCallback,
  39. List<Locale>? supportedLocales,
  40. bool? useMaterial,
  41. bool? useCupertino,
  42. bool? switchUI,
  43. bool? allowChangeUI,
  44. bool? debugShowMaterialGrid,
  45. bool? showPerformanceOverlay,
  46. bool? checkerboardRasterCacheImages,
  47. bool? checkerboardOffscreenLayers,
  48. bool? showSemanticsDebugger,
  49. bool? debugShowCheckedModeBanner,
  50. bool? debugShowWidgetInspector,
  51. bool? debugPaintSizeEnabled,
  52. bool? debugPaintBaselinesEnabled,
  53. bool? debugPaintPointersEnabled,
  54. bool? debugPaintLayerBordersEnabled,
  55. bool? debugRepaintRainbowEnabled,
  56. bool? debugRepaintTextRainbowEnabled,
  57. bool? debugPrintRebuildDirtyWidgets,
  58. void debugOnRebuildDirtyWidget(
    1. Element e,
    2. bool builtOnce
    )?,
  59. bool? debugPrintBuildScope,
  60. bool? debugPrintScheduleBuildForStacks,
  61. bool? debugPrintGlobalKeyedWidgetLifecycle,
  62. bool? debugProfileBuildsEnabled,
  63. bool? debugProfileBuildsEnabledUserWidgets,
  64. bool? debugEnhanceBuildTimelineArguments,
  65. bool? debugHighlightDeprecatedWidgets,
  66. Map<LogicalKeySet, Intent>? shortcuts,
  67. Map<Type, Action<Intent>>? actions,
  68. String? restorationScopeId,
  69. ScrollBehavior? scrollBehavior,
  70. FlutterExceptionHandler? errorHandler,
  71. ErrorWidgetBuilder? errorScreen,
  72. ReportErrorHandler? errorReport,
  73. void inErrorHandler(
    1. FlutterErrorDetails details
    )?,
  74. ErrorWidgetBuilder? inErrorScreen,
  75. Future<void> inErrorReport(
    1. Object exception,
    2. StackTrace stack
    )?,
  76. void inError(
    1. FlutterErrorDetails details
    )?,
  77. void inInitState()?,
  78. Future<bool> inInitAsync()?,
  79. Widget inHome()?,
  80. RouteInformationProvider inRouteInformationProvider()?,
  81. RouteInformationParser<Object> inRouteInformationParser()?,
  82. RouterDelegate<Object> inRouterDelegate()?,
  83. RouterConfig<Object>? inRouterConfig()?,
  84. BackButtonDispatcher inBackButtonDispatcher()?,
  85. Map<String, WidgetBuilder> inRoutes()?,
  86. String inInitialRoute()?,
  87. List<NavigatorObserver> inNavigatorObservers()?,
  88. bool inUpdateShouldNotify(
    1. InheritedWidget oldWidget
    )?,
  89. TransitionBuilder inTransBuilder()?,
  90. String inTitle()?,
  91. GenerateAppTitle? inGenerateTitle,
  92. ThemeData? inTheme()?,
  93. CupertinoThemeData? iniOSTheme()?,
  94. ThemeData? inDarkTheme()?,
  95. ThemeData? inHighContrastTheme()?,
  96. ThemeData? inHighContrastDarkTheme()?,
  97. ThemeMode? inThemeMode()?,
  98. Duration? inThemeAnimationDuration()?,
  99. Curve? inThemeAnimationCurve()?,
  100. Color? inColor()?,
  101. Locale? inLocale()?,
  102. Iterable<LocalizationsDelegate> inLocalizationsDelegates()?,
  103. LocaleListResolutionCallback? inLocaleListResolutionCallback,
  104. LocaleResolutionCallback? inLocaleResolutionCallback,
  105. List<Locale>? inSupportedLocales()?,
  106. bool? inDebugShowMaterialGrid()?,
  107. bool? inShowPerformanceOverlay()?,
  108. bool? inCheckerboardRasterCacheImages()?,
  109. bool? inCheckerboardOffscreenLayers()?,
  110. bool? inShowSemanticsDebugger()?,
  111. bool? inDebugShowCheckedModeBanner()?,
  112. Map<LogicalKeySet, Intent>? inShortcuts()?,
  113. Map<Type, Action<Intent>>? inActions()?,
  114. String? inRestorationScopeId()?,
  115. ScrollBehavior? inScrollBehavior()?,
  116. bool? inAsyncError(
    1. FlutterErrorDetails details
    )?,
})

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

Implementation

AppState({
  Key? key,
  Widget? home,
  AppController? controller,
  super.controllers,
  super.object,
  super.materialApp,
  super.cupertinoApp,
  RouteInformationProvider? routeInformationProvider,
  RouteInformationParser<Object>? routeInformationParser,
  RouterDelegate<Object>? routerDelegate,
  this.useRouterConfig,
  RouterConfig<Object>? routerConfig,
  BackButtonDispatcher? backButtonDispatcher,
  GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  Map<String, WidgetBuilder>? routes,
  String? initialRoute,
  Route<dynamic>? Function(RouteSettings settings)? onGenerateRoute,
  Route<dynamic>? Function(RouteSettings settings)? onUnknownRoute,
  bool Function(NavigationNotification notification)?
      onNavigationNotification,
  List<NavigatorObserver>? navigatorObservers,
  TransitionBuilder? builder,
  String? title,
  String Function(BuildContext context)? onGenerateTitle,
  Color? color,
  bool? allowChangeTheme,
  ThemeData? theme,
  CupertinoThemeData? iOSTheme,
  ThemeData? darkTheme,
  ThemeData? highContrastTheme,
  ThemeData? highContrastDarkTheme,
  ThemeMode? themeMode,
  Duration? themeAnimationDuration,
  Curve? themeAnimationCurve,
  bool? allowChangeLocale,
  Locale? locale,
  Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates,
  LocaleListResolutionCallback? localeListResolutionCallback,
  LocaleResolutionCallback? localeResolutionCallback,
  List<Locale>? supportedLocales,
  bool? useMaterial,
  bool? useCupertino,
  bool? switchUI,
  bool? allowChangeUI,
  bool? debugShowMaterialGrid,
  bool? showPerformanceOverlay,
  bool? checkerboardRasterCacheImages,
  bool? checkerboardOffscreenLayers,
  bool? showSemanticsDebugger,
  bool? debugShowCheckedModeBanner,
  bool? debugShowWidgetInspector,
  bool? debugPaintSizeEnabled,
  bool? debugPaintBaselinesEnabled,
  bool? debugPaintPointersEnabled,
  bool? debugPaintLayerBordersEnabled,
  bool? debugRepaintRainbowEnabled,
  bool? debugRepaintTextRainbowEnabled,
  bool? debugPrintRebuildDirtyWidgets,
  // ignore: avoid_positional_boolean_parameters
  void Function(Element e, bool builtOnce)? debugOnRebuildDirtyWidget,
  bool? debugPrintBuildScope,
  bool? debugPrintScheduleBuildForStacks,
  bool? debugPrintGlobalKeyedWidgetLifecycle,
  bool? debugProfileBuildsEnabled,
  bool? debugProfileBuildsEnabledUserWidgets,
  bool? debugEnhanceBuildTimelineArguments,
  bool? debugHighlightDeprecatedWidgets,
  Map<LogicalKeySet, Intent>? shortcuts,
  Map<Type, Action<Intent>>? actions,
  String? restorationScopeId,
  ScrollBehavior? scrollBehavior,
  super.errorHandler,
  super.errorScreen,
  super.errorReport,
  super.inErrorHandler,
  super.inErrorScreen,
  super.inErrorReport,
  super.inError,
  super.inInitState,
  super.inInitAsync,
  super.inHome,
  super.inRouteInformationProvider,
  super.inRouteInformationParser,
  super.inRouterDelegate,
  super.inRouterConfig,
  super.inBackButtonDispatcher,
  super.inRoutes,
  super.inInitialRoute,
  super.inNavigatorObservers,
  super.inUpdateShouldNotify,
  super.inTransBuilder,
  super.inTitle,
  super.inGenerateTitle,
  super.inTheme,
  super.iniOSTheme,
  super.inDarkTheme,
  super.inHighContrastTheme,
  super.inHighContrastDarkTheme,
  super.inThemeMode,
  super.inThemeAnimationDuration,
  super.inThemeAnimationCurve,
  super.inColor,
  super.inLocale,
  super.inLocalizationsDelegates,
  super.inLocaleListResolutionCallback,
  super.inLocaleResolutionCallback,
  super.inSupportedLocales,
  super.inDebugShowMaterialGrid,
  super.inShowPerformanceOverlay,
  super.inCheckerboardRasterCacheImages,
  super.inCheckerboardOffscreenLayers,
  super.inShowSemanticsDebugger,
  super.inDebugShowCheckedModeBanner,
  super.inShortcuts,
  super.inActions,
  super.inRestorationScopeId,
  super.inScrollBehavior,
  super.inAsyncError,
}) : super(controller: controller ?? AppController()) {
  //
  _key = key;
  _home = home;
  _title = title ?? '';

  // Determine what the app can change at runtime
  _allowChangeTheme = allowChangeTheme ?? false;
  _allowChangeLocale = allowChangeLocale ?? false;
  _allowChangeUI = allowChangeUI ?? false;

  // In case null was explicitly passed in.
  _useMaterial = useMaterial ?? false;
  _useCupertino = useCupertino ?? false;
  _switchUI = switchUI ?? false;

  /// Set _useMaterial or _useCupertino to true
  _useMaterialOrCupertino();

  _routeInformationProvider = routeInformationProvider;
  _routeInformationParser = routeInformationParser;
  _routerDelegate = routerDelegate;
  _routerConfig = routerConfig;
  _backButtonDispatcher = backButtonDispatcher;
  _scaffoldMessengerKey = scaffoldMessengerKey;
  _routes = routes;
  _initialRoute = initialRoute;
  _onGenerateRoute = onGenerateRoute;
  _onUnknownRoute = onUnknownRoute;
  _onNavigationNotification = onNavigationNotification;
  _navigatorObservers = navigatorObservers;
  _transitBuilder = builder;
  _onGenerateTitle = onGenerateTitle;
  _color = color;
  _theme = theme;
  _iOSTheme = iOSTheme;
  _darkTheme = darkTheme;
  _highContrastTheme = highContrastTheme;
  _highContrastDarkTheme = highContrastDarkTheme;
  _themeMode = themeMode;
  _themeAnimationDuration = themeAnimationDuration;
  _themeAnimationCurve = themeAnimationCurve;
  _locale = locale;
  _localizationsDelegates = localizationsDelegates;
  _localeListResolutionCallback = localeListResolutionCallback;
  _localeResolutionCallback = localeResolutionCallback;
  _supportedLocales = supportedLocales ?? [];
  _debugShowMaterialGrid = debugShowMaterialGrid;
  _showPerformanceOverlay = showPerformanceOverlay;
  _checkerboardRasterCacheImages = checkerboardRasterCacheImages;
  _checkerboardOffscreenLayers = checkerboardOffscreenLayers;
  _showSemanticsDebugger = showSemanticsDebugger;
  _debugShowCheckedModeBanner = debugShowCheckedModeBanner;
  _debugShowWidgetInspector = debugShowWidgetInspector;

  this.debugPaintSizeEnabled = debugPaintSizeEnabled ?? false;
  this.debugPaintBaselinesEnabled = debugPaintBaselinesEnabled ?? false;
  this.debugPaintPointersEnabled = debugPaintPointersEnabled ?? false;
  this.debugPaintLayerBordersEnabled = debugPaintLayerBordersEnabled ?? false;
  this.debugRepaintRainbowEnabled = debugRepaintRainbowEnabled ?? false;
  this.debugRepaintTextRainbowEnabled =
      debugRepaintTextRainbowEnabled ?? false;

  this.debugPrintRebuildDirtyWidgets = debugPrintRebuildDirtyWidgets ?? false;
  this.debugOnRebuildDirtyWidget = debugOnRebuildDirtyWidget;
  this.debugPrintBuildScope = debugPrintBuildScope ?? false;
  this.debugPrintScheduleBuildForStacks =
      debugPrintScheduleBuildForStacks ?? false;
  this.debugPrintGlobalKeyedWidgetLifecycle =
      debugPrintGlobalKeyedWidgetLifecycle ?? false;
  this.debugProfileBuildsEnabled = debugProfileBuildsEnabled ?? false;
  this.debugProfileBuildsEnabledUserWidgets =
      debugProfileBuildsEnabledUserWidgets ?? false;
  this.debugEnhanceBuildTimelineArguments =
      debugEnhanceBuildTimelineArguments ?? false;
  this.debugHighlightDeprecatedWidgets =
      debugHighlightDeprecatedWidgets ?? false;

  _shortcuts = shortcuts;
  _actions = actions;
  _restorationScopeId = restorationScopeId;
  _scrollBehavior = scrollBehavior;
}