AppObject class Get started App object

This class is available throughout the app readily supplies static properties about the App.

dartdoc:

Mixed-in types
Available extensions

Constructors

AppObject({@Deprecated("The 'error' parameter is deprecated.") bool? allowNewHandlers = true})
One single instance of the App object
factory

Properties

allowChangeLocale bool
Is this app allowed to manually change locale?
no setter
allowChangeLocale bool

Available on AppObject, provided by the AppStateExtension extension

Allow the app directly change the Locale
no setter
allowChangeTheme bool
App is allowed to change the app's theme Is this app allowed to manually change locale?
no setter
allowChangeTheme bool

Available on AppObject, provided by the AppStateExtension extension

Allow the app to change the theme
no setter
allowChangeUI bool

Available on AppObject, provided by the AppStateExtension extension

Allow the app to directly change the UI design
no setter
allowChangeUI bool
Is this app allowed to change the very UI (Material, Cupertino, etc.)
no setter
appName String?
The Name of the App.
no setterinherited
appState AppState<StatefulWidget>?
The App State object.
getter/setter pair
asSmallScreen bool
Set whether the app is to use a 'small screen' or not.
no setter
baseiOSTheme CupertinoThemeData?
Retain the original iOS theme
getter/setter pairinherited
baseTheme ThemeData?
Retain the original Android theme
getter/setter pairinherited
builder TransitionBuilder?

Available on AppObject, provided by the AppStateExtension extension

if neither routes, or onGenerateRoute was passed.
no setter
buildNumber String?
The build number of the App.
no setterinherited
checkerboardOffscreenLayers bool?

Available on AppObject, provided by the AppStateExtension extension

Checkerboard layers rendered offscreen bitmaps.
getter/setter pair
checkerboardRasterCacheImages bool?

Available on AppObject, provided by the AppStateExtension extension

Checkerboard raster cache to speed up overall rendering.
getter/setter pair
color Color?

Available on AppObject, provided by the AppStateExtension extension

Returns the Color passed to the app.
no setter
connectivity String?
Returns the connection status of the device.
no setter
context BuildContext?

Available on AppObject, provided by the AppStateExtension extension

Retrieve the 'latest' context
no setter
debugPaintBaselinesEnabled bool?

Available on AppObject, provided by the AppStateExtension extension

RenderBox paints a line at its baselines.
getter/setter pair
debugPaintLayerBordersEnabled bool?

Available on AppObject, provided by the AppStateExtension extension

Layer paints a box around its bound.
getter/setter pair
debugPaintPointersEnabled bool?

Available on AppObject, provided by the AppStateExtension extension

Objects flash while they are being tapped.
getter/setter pair
debugPaintSizeEnabled bool?

Available on AppObject, provided by the AppStateExtension extension

Each RenderBox to paint a box around its bounds.
getter/setter pair
debugRepaintRainbowEnabled bool?

Available on AppObject, provided by the AppStateExtension extension

Overlay a rotating set of colors when repainting layers in checked mode.
getter/setter pair
debugShowCheckedModeBanner bool?

Available on AppObject, provided by the AppStateExtension extension

Shows a little "DEBUG" banner in checked mode.
getter/setter pair
debugShowMaterialGrid bool?

Available on AppObject, provided by the AppStateExtension extension

If true, it paints a grid overlay on Material apps.
getter/setter pair
errorHandler AppErrorHandler?
Returns the current Error Handler.
no setter
filesDir String?
The local directory for this App.
no setter
goRouter GoRouter?
Reference a possible GoRouter
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hotReload bool
Flag to set hot reload from now on.
getter/setter pair
inDebugMode bool

Available on AppObject, provided by the AppStateExtension extension

Determines if running in an IDE or in production.
no setter
inFlutterTest bool
Indicate if running under a 'Flutter Test' environment
no setter
initialRoute String?

Available on AppObject, provided by the AppStateExtension extension

Returns to the initial route used by the app.
no setter
inSmallScreen bool
Return the bool value indicating if running in a small screen or not.
no setter
installNum String?
The unique id for this app's particular installation.
no setter
inWidgetsFlutterBinding bool
Indicating app is running in the Flutter engine and not in the flutter_test framework with TestWidgetsFlutterBinding for example
no setter
iOSThemeData CupertinoThemeData?
The app's current Cupertino theme.
getter/setter pairinherited
isInit bool?
Determine if the App initialized successfully.
getter/setter pair
isOnline bool
Indicates if the app has access to the Internet. Assume we're online if null
no setter
locale Locale?

Available on AppObject, provided by the AppStateExtension extension

Returns the device's possibly ever-changing Locale. Notice how the AppState's locale is always the determined locale.
getter/setter pair
localeResolutionCallback LocaleResolutionCallback?

Available on AppObject, provided by the AppStateExtension extension

Resolves the app's locale.
no setter
mainWindow FlutterView
Flutter application's main window.
no setter
Use this to navigate throughout the your app
no setter
Return the navigator key used by the App's View.
final

Available on AppObject, provided by the AppStateExtension extension

The list of observers for the Navigator for this app.
no setter
onGenerateRoute RouteFactory?

Available on AppObject, provided by the AppStateExtension extension

The route generator used when the app is navigated to a named route.
no setter
onGenerateTitle GenerateAppTitle?

Available on AppObject, provided by the AppStateExtension extension

Routine used to generate the App's title.
no setter
onUnknownRoute RouteFactory?

Available on AppObject, provided by the AppStateExtension extension

Called when onGenerateRoute fails except for the initialRoute.
no setter
packageInfo → PackageInfo?
The package info.
no setterinherited
packageName String?
The 'Package Name' of the App.
no setterinherited
platform TargetPlatform?
The running platform
no setter
preferredLocale Locale?
Return the saved Locale if any.
no setter
router NavigatorState
Merely another name for it.
no setter
routes Map<String, WidgetBuilder>?

Available on AppObject, provided by the AppStateExtension extension

Returns the routes used by the App's View.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaffold ScaffoldState?
The Scaffold object for this App's View.
no setter
scaffoldMessengerKey GlobalKey<ScaffoldMessengerState>?

Available on AppObject, provided by the AppStateExtension extension

Return the navigator key used by the App's View.
no setter
screenHeight double
The 'Logical' height of the screen
no setter
screenPhysicalHeight double
The Physical height of the screen
no setter
screenPhysicalWidth double
The Physical width of the screen
no setter
screenSize Size
Current Screen Size
no setter
screenWidth double
The 'logical' width of the screen
no setter
showPerformanceOverlay bool?

Available on AppObject, provided by the AppStateExtension extension

If true, it turns on a performance overlay.
getter/setter pair
showSemanticsDebugger bool?

Available on AppObject, provided by the AppStateExtension extension

Shows an overlay of accessibility information
getter/setter pair
standAloneApp bool?
Determine if this app is running alone
getter/setter pair
supportedLocales List<Locale>?

Available on AppObject, provided by the AppStateExtension extension

getter, supportedLocales, returns a List of the App's locales.
no setter
switchUI bool

Available on AppObject, provided by the AppStateExtension extension

Use Cupertino UI in Android and vice versa.
no setter
themeData ThemeData?
The App's current Material theme.
getter/setter pairinherited
title String

Available on AppObject, provided by the AppStateExtension extension

Returns the title for the App's View.
no setter
turnedOffInternet bool
Was on but now turned off connectivity
no setter
turnedOnInternet bool
Was off but now turned on connectivity
no setter
useCupertino bool

Available on AppObject, provided by the AppStateExtension extension

Indicates if the App is running the Cupertino interface theme.
no setter
useMaterial bool

Available on AppObject, provided by the AppStateExtension extension

Indicates if the App is running the Material interface theme.
no setter
version String?
The current version of the App.
no setterinherited

Methods

addConnectivityListener(ConnectivityListener? listener) bool
Add a Connectivity listener.
canPop() bool

Available on AppObject, provided by the AppNavigationExtension extension

Whether the navigator can be popped.
catchError(Object? ex, {StackTrace? stack, String? library, DiagnosticsNode? context, IterableFilter<String>? stackFilter, InformationCollector? informationCollector, bool? silent}) → void

Available on AppObject, provided by the AppStateExtension extension

Catch and explicitly handle the error.
changeLocale(Locale? locale) Future<bool>

Available on AppObject, provided by the AppStateExtension extension

Explicitly change the app's locale.
changeUI(String ui) → void

Available on AppObject, provided by the AppStateExtension extension

Explicitly change to a particular interface.
dependOnInheritedWidget(BuildContext? context) → void

Available on AppObject, provided by the AppStateExtension extension

Link a widget to a InheritedWidget in the root State object.
dispose() → void
Dispose the App properties.
finalizeRoute(Route route) → void

Available on AppObject, provided by the AppNavigationExtension extension

Complete the lifecycle for a route that has been popped off the navigator.
getDeviceInfo() Future<void>
Collect the device's information.
getInstallNum() Future<String?>
The id for this App's particular installation.
getMaterialColor(Color? color) MaterialColor?
No longer used
inherited
initInternal() Future<void>
Internal Initialization routines.
maybePop<T extends Object?>([T? result]) Future<bool>

Available on AppObject, provided by the AppNavigationExtension extension

potentially popping the route as a result; returns whether the pop request should be considered handled.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyClients() → void

Available on AppObject, provided by the AppStateExtension extension

Rebuild dependencies to the root State object's InheritedWidget
onAsyncError(AsyncSnapshot<bool> snapshot) → void
App-level error handling if async operation at start up fails
onConnectivityChanged(ConnectivityResult result) → void
override
onError(FlutterErrorDetails details) → void
App-level error handling.
pop<T extends Object?>([T? result]) → void

Available on AppObject, provided by the AppNavigationExtension extension

Pop the top-most route off the navigator.
popAndPushNamed<T extends Object?, TO extends Object?>(String routeName, {TO? result, Object? arguments}) Future<T?>

Available on AppObject, provided by the AppNavigationExtension extension

Pop the current route off the navigator and push a named route in its place.
popUntil(RoutePredicate predicate) → void

Available on AppObject, provided by the AppNavigationExtension extension

Calls pop repeatedly until the predicate returns true.
push<T extends Object?>(Route<T> route) Future<T?>

Available on AppObject, provided by the AppNavigationExtension extension

Push the given route onto the navigator.
pushAndRemoveUntil<T extends Object?>(Route<T> newRoute, RoutePredicate predicate) Future<T?>

Available on AppObject, provided by the AppNavigationExtension extension

Push the given route onto the navigator, and then remove all the previous routes until the predicate returns true.
pushNamed<T extends Object?>(String routeName, {Object? arguments}) Future<T?>

Available on AppObject, provided by the AppNavigationExtension extension

Push a named route onto the navigator.
pushNamedAndRemoveUntil<T extends Object?>(String newRouteName, RoutePredicate predicate, {Object? arguments}) Future<T?>

Available on AppObject, provided by the AppNavigationExtension extension

Push the route with the given name onto the navigator, and then remove all the previous routes until the predicate returns true.
pushReplacement<T extends Object?, TO extends Object?>(Route<T> newRoute, {TO? result}) Future<T?>

Available on AppObject, provided by the AppNavigationExtension extension

Replace the current route of the navigator by pushing the given route and then disposing the previous route once the new route has finished animating in.
pushReplacementNamed<T extends Object?, TO extends Object?>(String routeName, {TO? result, Object? arguments}) Future<T?>

Available on AppObject, provided by the AppNavigationExtension extension

Replace the current route of the navigator by pushing the route named routeName and then disposing the previous route once the new route has finished animating in.
refresh() → void

Available on AppObject, provided by the AppStateExtension extension

Refresh the 'current/latest' State object and 'root/first' State object.
removeConnectivityListener(ConnectivityListener? listener) bool
Remove a Connectivity listener.
removeRoute(Route route) → void

Available on AppObject, provided by the AppNavigationExtension extension

Immediately remove route from the navigator, and Route.dispose it.
removeRouteBelow(Route anchorRoute) → void

Available on AppObject, provided by the AppNavigationExtension extension

Immediately remove a route from the navigator, and Route.dispose it. The route to be removed is the one below the given anchorRoute.
replace<T extends Object?>({required Route oldRoute, required Route<T> newRoute}) → void

Available on AppObject, provided by the AppNavigationExtension extension

Replaces a route on the navigator that most tightly encloses the given context with a new route.
replaceRouteBelow<T extends Object?>({required Route anchorRoute, required Route<T> newRoute}) → void

Available on AppObject, provided by the AppNavigationExtension extension

Replaces a route on the navigator with a new route. The route to be replaced is the one below the given anchorRoute.
restorablePopAndPushNamed<T extends Object?, TO extends Object?>(String routeName, {TO? result, Object? arguments}) String

Available on AppObject, provided by the AppNavigationExtension extension

Pop the current route off the navigator and push a named route in its place.
restorablePush<T extends Object?>(RestorableRouteBuilder<T> routeBuilder, {Object? arguments}) String

Available on AppObject, provided by the AppNavigationExtension extension

Push a new route onto the navigator.
restorablePushAndRemoveUntil<T extends Object?>(RestorableRouteBuilder<T> newRouteBuilder, RoutePredicate predicate, {Object? arguments}) String

Available on AppObject, provided by the AppNavigationExtension extension

Push a new route onto the navigator, and then remove all the previous routes until the predicate returns true.
restorablePushNamed<T extends Object?>(String routeName, {Object? arguments}) String

Available on AppObject, provided by the AppNavigationExtension extension

Push a named route onto the navigator.
restorablePushNamedAndRemoveUntil<T extends Object?>(String newRouteName, RoutePredicate predicate, {Object? arguments}) String

Available on AppObject, provided by the AppNavigationExtension extension

Push the route with the given name onto the navigator that most tightly encloses the given context, and then remove all the previous routes until the predicate returns true.
restorablePushReplacement<T extends Object?, TO extends Object?>(RestorableRouteBuilder<T> routeBuilder, {TO? result, Object? arguments}) String

Available on AppObject, provided by the AppNavigationExtension extension

Replace the current route of the navigator by pushing a new route and then disposing the previous route once the new route has finished animating in.
restorablePushReplacementNamed<T extends Object?, TO extends Object?>(String routeName, {TO? result, Object? arguments}) String

Available on AppObject, provided by the AppNavigationExtension extension

Replace the current route of the navigator that most tightly encloses the given context by pushing the route named routeName and then disposing the previous route once the new route has finished animating in.
restorableReplace<T extends Object?>({required Route oldRoute, required RestorableRouteBuilder<T> newRouteBuilder, Object? arguments}) String

Available on AppObject, provided by the AppNavigationExtension extension

Replaces a route on the navigator that most tightly encloses the given context with a new route.
restorableReplaceRouteBelow<T extends Object?>({required Route anchorRoute, required RestorableRouteBuilder<T> newRouteBuilder, Object? arguments}) String

Available on AppObject, provided by the AppNavigationExtension extension

Replaces a route on the navigator with a new route. The route to be replaced is the one below the given anchorRoute.
saveLocale([Locale? locale]) Future<bool>
Save a locale to the app's locale
setState(VoidCallback fn) → void

Available on AppObject, provided by the AppStateExtension extension

Refresh the root State object with the passed function.
setThemeData({ColorSwatch<int?>? swatch}) Color?
Set the app's general color theme supplying a Color value.
inherited
snackBar({Key? key, required Widget content, Color? backgroundColor, double? elevation, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, double? width, ShapeBorder? shape, SnackBarBehavior? behavior, SnackBarAction? action, Duration? duration, Animation<double>? animation, VoidCallback? onVisible, DismissDirection? dismissDirection, Clip? clipBehavior}) → void
Display the SnackBar
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited