AppState<T extends StatefulWidget> constructor
AppState<T extends StatefulWidget> ({
- Key? key,
- Widget? home,
- AppController? controller,
- List<
StateXController> ? controllers, - void binding()?,
- List<
Function> ? bindings, - Object? object,
- MaterialApp? materialApp,
- CupertinoApp? cupertinoApp,
- RouteInformationProvider? routeInformationProvider,
- RouteInformationParser<
Object> ? routeInformationParser, - RouterDelegate<
Object> ? routerDelegate, - RouterConfig<
Object> ? routerConfig, - BackButtonDispatcher? backButtonDispatcher,
- GlobalKey<
ScaffoldMessengerState> ? scaffoldMessengerKey, - Map<
String, WidgetBuilder> ? routes, - String? initialRoute,
- RouteFactory? onGenerateRoute,
- RouteFactory? onUnknownRoute,
- TransitionBuilder? builder,
- String? title,
- GenerateAppTitle? onGenerateTitle,
- ThemeData? theme,
- CupertinoThemeData? iOSTheme,
- ThemeData? darkTheme,
- ThemeMode? themeMode,
- Color? color,
- Locale? locale,
- Iterable<
LocalizationsDelegate> ? localizationsDelegates, - LocaleListResolutionCallback? localeListResolutionCallback,
- LocaleResolutionCallback? localeResolutionCallback,
- List<
Locale> ? supportedLocales, - bool? useMaterial,
- bool? useCupertino,
- bool? switchUI,
- bool? debugShowMaterialGrid,
- bool? showPerformanceOverlay,
- bool? checkerboardRasterCacheImages,
- bool? checkerboardOffscreenLayers,
- bool? showSemanticsDebugger,
- bool? debugShowCheckedModeBanner,
- Map<
LogicalKeySet, Intent> ? shortcuts, - Map<
Type, Action< ? actions,Intent> > - CustomTransition? customTransition,
- Map<
String, Map< ? translationsKeys,String, String> > - Translations? translations,
- TextDirection? textDirection,
- Locale? fallbackLocale,
- ValueChanged<
Routing?> ? routingCallback, - Transition? defaultTransition,
- bool? opaqueRoute,
- VoidCallback? onInit,
- VoidCallback? onReady,
- VoidCallback? onDispose,
- bool? enableLog,
- LogWriterCallback? logWriterCallback,
- bool? popGesture,
- SmartManagement? smartManagement,
- Bindings? initialBinding,
- Duration? transitionDuration,
- bool? defaultGlobalState,
- List<
GetPage> ? getPages, - bool? useRouter,
- GetPage? unknownRoute,
- ScrollBehavior? scrollBehavior,
- bool? useInheritedMediaQuery,
- bool? debugShowWidgetInspector,
- bool? debugPaintSizeEnabled,
- bool? debugPaintBaselinesEnabled,
- bool? debugPaintPointersEnabled,
- bool? debugPaintLayerBordersEnabled,
- bool? debugRepaintRainbowEnabled,
- bool? debugRepaintTextRainbowEnabled,
- FlutterExceptionHandler? errorHandler,
- ErrorWidgetBuilder? errorScreen,
- ReportErrorHandler? errorReport,
- FlutterExceptionHandler? inErrorHandler,
- ErrorWidgetBuilder? inErrorScreen,
- Future<
void> inErrorReport(- Object exception,
- StackTrace stack
- void inInitState()?,
- Future<
bool> inInitAsync()?, - void inBinding()?,
- Widget inHome()?,
- RouteInformationProvider inRouteInformationProvider()?,
- RouteInformationParser<
Object> inRouteInformationParser()?, - RouterDelegate<
Object> inRouterDelegate()?, - RouterConfig<
Object> ? inRouterConfig()?, - BackButtonDispatcher inBackButtonDispatcher()?,
- Map<
String, WidgetBuilder> inRoutes()?, - String inInitialRoute()?,
- RouteFactory inOnGenerateRoute()?,
- RouteFactory inOnUnknownRoute()?,
- TransitionBuilder inTransBuilder()?,
- String inTitle()?,
- GenerateAppTitle? inGenerateTitle,
- ThemeData? inTheme()?,
- CupertinoThemeData? iniOSTheme()?,
- ThemeData? inDarkTheme()?,
- ThemeMode? inThemeMode()?,
- 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()?,
- bool? inInheritedMediaQuery()?,
- void inError(
- FlutterErrorDetails details
- bool? inAsyncError(
- FlutterErrorDetails details
Provide a huge array of options and features to the 'App State object.'
Implementation
AppState({
this.key,
this.home,
AppController? controller,
super.controllers,
this.binding,
this.bindings,
super.object,
super.materialApp,
super.cupertinoApp,
@Deprecated('No longer available to the user.') super.navigatorKey,
super.routeInformationProvider,
super.routeInformationParser,
super.routerDelegate,
super.routerConfig,
super.backButtonDispatcher,
super.scaffoldMessengerKey,
super.routes,
super.initialRoute,
super.onGenerateRoute,
super.onUnknownRoute,
super.navigatorObservers,
super.builder,
super.title,
super.onGenerateTitle,
super.theme,
super.iOSTheme,
super.darkTheme,
super.themeMode,
super.color,
super.locale,
super.localizationsDelegates,
super.localeListResolutionCallback,
super.localeResolutionCallback,
super.supportedLocales,
this.useMaterial,
this.useCupertino,
this.switchUI,
super.debugShowMaterialGrid,
super.showPerformanceOverlay,
super.checkerboardRasterCacheImages,
super.checkerboardOffscreenLayers,
super.showSemanticsDebugger,
super.debugShowCheckedModeBanner,
super.shortcuts,
super.actions,
super.customTransition,
super.translationsKeys,
super.translations,
super.textDirection,
super.fallbackLocale,
super.routingCallback,
super.defaultTransition,
super.opaqueRoute,
super.onInit,
super.onReady,
super.onDispose,
super.enableLog,
super.logWriterCallback,
super.popGesture,
super.smartManagement,
super.initialBinding,
super.transitionDuration,
super.defaultGlobalState,
super.getPages,
this.useRouter,
super.unknownRoute,
// super.restorationScopeId,
super.scrollBehavior,
super.useInheritedMediaQuery,
super.debugShowWidgetInspector,
super.debugPaintSizeEnabled,
super.debugPaintBaselinesEnabled,
super.debugPaintPointersEnabled,
super.debugPaintLayerBordersEnabled,
super.debugRepaintRainbowEnabled,
super.debugRepaintTextRainbowEnabled,
super.errorHandler,
super.errorScreen,
super.errorReport,
super.inErrorHandler,
super.inErrorScreen,
super.inErrorReport,
this.inInitState,
this.inInitAsync,
this.inBinding,
this.inHome,
this.inRouteInformationProvider,
this.inRouteInformationParser,
this.inRouterDelegate,
this.inRouterConfig,
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,
}) : _stateRouteObserver = StateRouteObserver(),
super(controller: controller ?? AppController()) {
// 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;
}