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

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.notifyClientsInBuild,
  super.materialApp,
  super.cupertinoApp,
  RouteInformationProvider? routeInformationProvider,
  RouteInformationParser<Object>? routeInformationParser,
  RouterDelegate<Object>? routerDelegate,
  bool? 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,
  GlobalKey<NavigatorState>? navigatorKey,
  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,
  this.maxMobileWidth,
  this.maxTabletWidth,
  super.errorHandler,
  super.errorScreen,
  super.errorReport,
  super.inErrorHandler,
  super.inErrorScreen,
  super.inErrorReport,
  super.presentError,
  super.inInitState,
  super.inInitAsync,
  super.inCatchAsyncError,
  super.inAsyncError,
  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(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;
  _useRouterConfig = useRouterConfig;
  _routerConfig = routerConfig;
  _backButtonDispatcher = backButtonDispatcher;
  _scaffoldMessengerKey = scaffoldMessengerKey;
  _routes = routes;
  _initialRoute = initialRoute;
  _onGenerateRoute = onGenerateRoute;
  _onUnknownRoute = onUnknownRoute;
  _onNavigationNotification = onNavigationNotification;
  _navigatorKey = navigatorKey;
  _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;
}