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
allowChangeTheme → bool
App is allowed to change the app's theme Is this app allowed to manually change locale?
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 ↔ AppStateX<StatefulWidget>?
The App State object.
getter/setter pair
asSmallScreen → bool
Set whether the app is to use a 'small screen' or not.
no setter
buildNumber → String?
The build number of the App.
no setterinherited
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
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
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
mainWindow → FlutterView
Flutter application's main window.
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
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
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
standAloneApp ↔ bool?
Determine if this app is running alone
getter/setter pair
themeData ↔ ThemeData?
The App's current Material theme.
getter/setter pairinherited
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.
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.
getDeviceInfo() → Future<void>
Collect the device's information.
getInstallNum() → Future<String?>
The id for this App's particular installation.
getMaterialColor(Color? color) → MaterialColor?
inherited
initInternal() → Future<void>
Internal Initialization routines.
logErrorDetails(FlutterErrorDetails details) → void
Log an Error
override
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
onConnectivityChanged(ConnectivityResult result) → void
override
onError(FlutterErrorDetails details) → void
Offer an error handler
inherited
refresh() → void

Available on AppObject, provided by the AppStateExtension extension

Refresh the 'current/latest' State object and 'root/first' State object. todo: Is refresh() deprecated?
removeConnectivityListener(ConnectivityListener? listener) → bool
Remove a Connectivity listener.
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, Widget? content, String? message, 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, int? durationMillis, int? animationDurationMillis}) → void
Display the SnackBar
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

logError ↔ bool
Flag whether to log the next error
getter/setter pair