AppStateX<T extends StatefulWidget> constructor

AppStateX<T extends StatefulWidget>({
  1. Key? key,
  2. Widget? home,
  3. AppStateXController? 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. AnimationStyle? themeAnimationStyle,
  73. FlutterExceptionHandler? errorHandler,
  74. ErrorWidgetBuilder? errorScreen,
  75. ReportErrorHandler? errorReport,
  76. void inErrorHandler(
    1. FlutterErrorDetails details
    )?,
  77. ErrorWidgetBuilder? inErrorScreen,
  78. Future<void> inErrorReport(
    1. Object exception,
    2. StackTrace stack
    )?,
  79. bool? presentError,
  80. void inInitState()?,
  81. Future<bool> inInitAsync()?,
  82. void inCatchAsyncError(
    1. Object error
    )?,
  83. void inAsyncError(
    1. Object error
    )?,
  84. Widget inHome()?,
  85. RouteInformationProvider inRouteInformationProvider()?,
  86. RouteInformationParser<Object> inRouteInformationParser()?,
  87. RouterDelegate<Object> inRouterDelegate()?,
  88. RouterConfig<Object>? inRouterConfig()?,
  89. BackButtonDispatcher inBackButtonDispatcher()?,
  90. Map<String, WidgetBuilder> inRoutes()?,
  91. String inInitialRoute()?,
  92. List<NavigatorObserver> inNavigatorObservers()?,
  93. bool inUpdateShouldNotify(
    1. InheritedWidget oldWidget
    )?,
  94. TransitionBuilder inTransBuilder()?,
  95. String inTitle()?,
  96. GenerateAppTitle? inGenerateTitle,
  97. ThemeData? inTheme()?,
  98. CupertinoThemeData? iniOSTheme()?,
  99. ThemeData? inDarkTheme()?,
  100. ThemeData? inHighContrastTheme()?,
  101. ThemeData? inHighContrastDarkTheme()?,
  102. ThemeMode? inThemeMode()?,
  103. Duration? inThemeAnimationDuration()?,
  104. Curve? inThemeAnimationCurve()?,
  105. Color? inColor()?,
  106. Locale? inLocale()?,
  107. Iterable<LocalizationsDelegate> inLocalizationsDelegates()?,
  108. LocaleListResolutionCallback? inLocaleListResolutionCallback,
  109. LocaleResolutionCallback? inLocaleResolutionCallback,
  110. List<Locale>? inSupportedLocales()?,
  111. bool? inDebugShowMaterialGrid()?,
  112. bool? inShowPerformanceOverlay()?,
  113. bool? inCheckerboardRasterCacheImages()?,
  114. bool? inCheckerboardOffscreenLayers()?,
  115. bool? inShowSemanticsDebugger()?,
  116. bool? inDebugShowCheckedModeBanner()?,
  117. Map<LogicalKeySet, Intent>? inShortcuts()?,
  118. Map<Type, Action<Intent>>? inActions()?,
  119. String? inRestorationScopeId()?,
  120. ScrollBehavior? inScrollBehavior()?,
  121. AnimationStyle? inThemeAnimationStyle()?,
})

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

Implementation

AppStateX({
  Key? key,
  Widget? home,
  AppStateXController? 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,
  AnimationStyle? themeAnimationStyle,
  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.inThemeAnimationStyle,
}) : super(controller: controller ?? AppStateXController()) {
  //
  _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;
  _themeAnimationStyle = themeAnimationStyle;
}