AppState<T extends StatefulWidget> constructor
AppState<T extends StatefulWidget> ({
- Key? key,
- Widget? home,
- AppController? controller,
- List<
StateXController> ? controllers, - 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> > - String? restorationScopeId,
- ScrollBehavior? scrollBehavior,
- bool? useInheritedMediaQuery,
- bool? debugShowWidgetInspector,
- bool? debugPaintSizeEnabled,
- bool? debugPaintBaselinesEnabled,
- bool? debugPaintPointersEnabled,
- bool? debugPaintLayerBordersEnabled,
- bool? debugRepaintRainbowEnabled,
- bool? debugRepaintTextRainbowEnabled,
- FlutterExceptionHandler? errorHandler,
- ErrorWidgetBuilder? errorScreen,
- ReportErrorHandler? errorReport,
- void inInitState()?,
- Future<
bool> inInitAsync()?, - 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,
super.object,
super.materialApp,
super.cupertinoApp,
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.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,
this.inInitState,
this.inInitAsync,
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,
}) : 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;
}