AppState<T extends AppStatefulWidgetMVC> constructor
AppState<T extends AppStatefulWidgetMVC> ({
- Key? key,
- Widget? home,
- AppController? con,
- List<
ControllerMVC> ? controllers, - Object? object,
- RouteInformationProvider? routeInformationProvider,
- RouteInformationParser<
Object> ? routeInformationParser, - RouterDelegate<
Object> ? routerDelegate, - 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,
- FlutterExceptionHandler? errorHandler,
- ErrorWidgetBuilder? errorScreen,
- ReportErrorHandler? errorReport,
- Widget inHome()?,
- RouteInformationProvider inRouteInformationProvider()?,
- RouteInformationParser<
Object> inRouteInformationParser()?, - RouterDelegate<
Object> inRouterDelegate()?, - 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? con,
List<ControllerMVC>? controllers,
Object? object,
GlobalKey<NavigatorState>? navigatorKey,
RouteInformationProvider? routeInformationProvider,
RouteInformationParser<Object>? routeInformationParser,
RouterDelegate<Object>? routerDelegate,
BackButtonDispatcher? backButtonDispatcher,
GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
Map<String, WidgetBuilder>? routes,
String? initialRoute,
RouteFactory? onGenerateRoute,
RouteFactory? onUnknownRoute,
List<NavigatorObserver>? navigatorObservers,
TransitionBuilder? builder,
String? title,
GenerateAppTitle? onGenerateTitle,
ThemeData? theme,
CupertinoThemeData? iOSTheme,
ThemeData? darkTheme,
ThemeMode? themeMode,
Color? color,
Locale? locale,
Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates,
LocaleListResolutionCallback? localeListResolutionCallback,
LocaleResolutionCallback? localeResolutionCallback,
List<Locale>? supportedLocales,
this.useMaterial,
this.useCupertino,
this.switchUI,
bool? debugShowMaterialGrid,
bool? showPerformanceOverlay,
bool? checkerboardRasterCacheImages,
bool? checkerboardOffscreenLayers,
bool? showSemanticsDebugger,
bool? debugShowCheckedModeBanner,
Map<LogicalKeySet, Intent>? shortcuts,
Map<Type, Action<Intent>>? actions,
String? restorationScopeId,
ScrollBehavior? scrollBehavior,
bool? useInheritedMediaQuery,
bool? debugShowWidgetInspector,
bool? debugPaintSizeEnabled,
bool? debugPaintBaselinesEnabled,
bool? debugPaintPointersEnabled,
bool? debugPaintLayerBordersEnabled,
bool? debugRepaintRainbowEnabled,
FlutterExceptionHandler? errorHandler,
ErrorWidgetBuilder? errorScreen,
v.ReportErrorHandler? errorReport,
this.inHome,
this.inRouteInformationProvider,
this.inRouteInformationParser,
this.inRouterDelegate,
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(
con: con ?? AppController(),
controllers: controllers,
object: object,
navigatorKey: navigatorKey,
routeInformationProvider: routeInformationProvider,
routeInformationParser: routeInformationParser,
routerDelegate: routerDelegate,
backButtonDispatcher: backButtonDispatcher,
scaffoldMessengerKey: scaffoldMessengerKey,
routes: routes,
initialRoute: initialRoute,
onGenerateRoute: onGenerateRoute,
onUnknownRoute: onUnknownRoute,
navigatorObservers: navigatorObservers,
builder: builder,
title: title,
onGenerateTitle: onGenerateTitle,
theme: theme,
iOSTheme: iOSTheme,
darkTheme: darkTheme,
themeMode: themeMode,
color: color,
locale: locale,
localizationsDelegates: localizationsDelegates,
localeListResolutionCallback: localeListResolutionCallback,
localeResolutionCallback: localeResolutionCallback,
supportedLocales: supportedLocales,
debugShowMaterialGrid: debugShowMaterialGrid,
showPerformanceOverlay: showPerformanceOverlay,
checkerboardRasterCacheImages: checkerboardRasterCacheImages,
checkerboardOffscreenLayers: checkerboardOffscreenLayers,
showSemanticsDebugger: showSemanticsDebugger,
debugShowCheckedModeBanner: debugShowCheckedModeBanner,
shortcuts: shortcuts,
actions: actions,
restorationScopeId: restorationScopeId,
scrollBehavior: scrollBehavior,
useInheritedMediaQuery: useInheritedMediaQuery,
debugShowWidgetInspector: debugShowWidgetInspector,
debugPaintSizeEnabled: debugPaintSizeEnabled,
debugPaintBaselinesEnabled: debugPaintBaselinesEnabled,
debugPaintPointersEnabled: debugPaintPointersEnabled,
debugPaintLayerBordersEnabled: debugPaintLayerBordersEnabled,
debugRepaintRainbowEnabled: debugRepaintRainbowEnabled,
errorHandler: errorHandler,
errorScreen: errorScreen,
errorReport: errorReport,
) {
// 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;
}