AppStateX<T extends StatefulWidget> constructor
AppStateX<T extends StatefulWidget> ({
- Key? key,
- Widget? home,
- AppStateXController? controller,
- List<
StateXController> ? controllers, - Object? object,
- bool? notifyClientsInBuild,
- MaterialApp? materialApp,
- CupertinoApp? 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? onGenerateRoute(
- RouteSettings settings
- Route? onUnknownRoute(
- RouteSettings settings
- TransitionBuilder? builder,
- String? title,
- String onGenerateTitle(
- BuildContext context
- 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> ? 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,
- void debugOnRebuildDirtyWidget()?,
- bool? debugPrintBuildScope,
- bool? debugPrintScheduleBuildForStacks,
- bool? debugPrintGlobalKeyedWidgetLifecycle,
- bool? debugProfileBuildsEnabled,
- bool? debugProfileBuildsEnabledUserWidgets,
- bool? debugEnhanceBuildTimelineArguments,
- bool? debugHighlightDeprecatedWidgets,
- Map<
LogicalKeySet, Intent> ? shortcuts, - Map<
Type, Action< ? actions,Intent> > - String? restorationScopeId,
- ScrollBehavior? scrollBehavior,
- AnimationStyle? themeAnimationStyle,
- FlutterExceptionHandler? errorHandler,
- ErrorWidgetBuilder? errorScreen,
- ReportErrorHandler? errorReport,
- void inErrorHandler(
- FlutterErrorDetails details
- ErrorWidgetBuilder? inErrorScreen,
- Future<
void> inErrorReport(- Object exception,
- StackTrace stack
- bool? presentError,
- void inInitState()?,
- Future<
bool> inInitAsync()?, - void inCatchAsyncError(
- Object error
- void inAsyncError(
- Object error
- Widget inHome()?,
- RouteInformationProvider inRouteInformationProvider()?,
- RouteInformationParser<
Object> inRouteInformationParser()?, - RouterDelegate<
Object> inRouterDelegate()?, - RouterConfig<
Object> ? inRouterConfig()?, - BackButtonDispatcher inBackButtonDispatcher()?,
- Map<
String, WidgetBuilder> inRoutes()?, - String inInitialRoute()?,
- bool inUpdateShouldNotify(
- InheritedWidget oldWidget
- TransitionBuilder inTransBuilder()?,
- String inTitle()?,
- GenerateAppTitle? inGenerateTitle,
- ThemeData? inTheme()?,
- CupertinoThemeData? iniOSTheme()?,
- ThemeData? inDarkTheme()?,
- ThemeData? inHighContrastTheme()?,
- ThemeData? inHighContrastDarkTheme()?,
- ThemeMode? inThemeMode()?,
- Duration? inThemeAnimationDuration()?,
- Curve? inThemeAnimationCurve()?,
- Color? inColor()?,
- Locale? inLocale()?,
- Iterable<
LocalizationsDelegate> inLocalizationsDelegates()?, - LocaleListResolutionCallback? inLocaleListResolutionCallback,
- LocaleResolutionCallback? inLocaleResolutionCallback,
- List<
Locale> ? inSupportedLocales()?, - bool? inDebugShowMaterialGrid()?,
- bool? inShowPerformanceOverlay()?,
- bool? inCheckerboardRasterCacheImages()?,
- bool? inCheckerboardOffscreenLayers()?,
- bool? inShowSemanticsDebugger()?,
- bool? inDebugShowCheckedModeBanner()?,
- Map<
LogicalKeySet, Intent> ? inShortcuts()?, - Map<
Type, Action< ? inActions()?,Intent> > - String? inRestorationScopeId()?,
- ScrollBehavior? inScrollBehavior()?,
- 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;
}