App class
This class is available throughout the app Readily supplies static properties about the App.
- Mixed-in types
Constructors
- App({FlutterExceptionHandler? errorHandler, ErrorWidgetBuilder? errorScreen, ReportErrorHandler? errorReport, bool allowNewHandlers = true})
-
Supply an error handler to the App.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - Dispose the App properties.
-
initInternal(
) → Future< void> - Internal Initialization routines.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAsyncError(
AsyncSnapshot< bool> snapshot) → void - App-level error handling if async operation at start up fails
-
onConnectivityChanged(
ConnectivityResult result) → void -
override
-
setAppState(
AppState< StatefulWidget> ? state) → bool - Assign the class with the AppState object.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- appName → String?
-
The Name of the App.
no setter
- asSmallScreen → bool
-
Set whether the app is to use a 'small screen' or not.
Determine if running on a desktop or on a phone or tablet
no setter
- builder ↔ TransitionBuilder?
-
if neither routes, or onGenerateRoute was passed.
getter/setter pair
- buildNumber → String?
-
The build number of the App.
no setter
- checkerboardOffscreenLayers ↔ bool?
-
Checkerboard layers rendered offscreen bitmaps.
getter/setter pair
- checkerboardRasterCacheImages ↔ bool?
-
Checkerboard raster cache to speed up overall rendering.
getter/setter pair
- color ↔ Color?
-
Returns the Color passed to the App's View.
getter/setter pair
- connectivity → String?
-
Returns the connection status of the device.
no setter
- context → BuildContext?
-
The BuildContext for the App's View.
no setter
- debugPaintBaselinesEnabled ↔ bool?
-
RenderBox paints a line at its baselines.
getter/setter pair
- debugPaintLayerBordersEnabled ↔ bool?
-
Layer paints a box around its bound.
getter/setter pair
- debugPaintPointersEnabled ↔ bool?
-
Objects flash while they are being tapped.
getter/setter pair
- debugPaintSizeEnabled ↔ bool?
-
Each RenderBox to paint a box around its bounds.
getter/setter pair
- debugRepaintRainbowEnabled ↔ bool?
-
Overlay a rotating set of colors when repainting layers in checked mode.
getter/setter pair
- debugShowCheckedModeBanner ↔ bool?
-
Shows a little "DEBUG" banner in checked mode.
getter/setter pair
- debugShowMaterialGrid ↔ bool?
-
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
- hotReload ↔ bool
-
Flag to set hot reload from now on.
getter/setter pair
- inDebugger → bool
-
Determines if running in an IDE or in production.
no setter
- initialRoute ↔ String?
-
Returns to the initial route used by the App's View.
getter/setter pair
- inSmallScreen → bool
-
Return the bool value indicating if running in a small screen or not.
no setter
- installNum → String?
-
The id for this App's particular installation.
no setter
- iOSTheme ↔ CupertinoThemeData?
-
The Apps's current Cupertino theme.
getter/setter pair
- 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?
-
Returns the device's every changing Locale.
getter/setter pair
- localeResolutionCallback ↔ LocaleResolutionCallback?
-
Resolves the App's locale.
getter/setter pair
-
localizationsDelegates
↔ Iterable<
LocalizationsDelegate> ? -
Returns the App's current localizations delegates.
getter/setter pair
- mainWindow → SingletonFlutterWindow
-
Flutter application's main window.
no setter
-
A mutable menu
no setter
-
Return the navigator key used by the App's View.
getter/setter pair
-
The list of observers for the Navigator for this app.
getter/setter pair
- onGenerateRoute ↔ RouteFactory?
-
The route generator used when the app is navigated to a named route.
getter/setter pair
- onGenerateTitle ↔ GenerateAppTitle?
-
Routine used to generate the App's title.
getter/setter pair
- onUnknownRoute ↔ RouteFactory?
-
Called when onGenerateRoute fails except for the initialRoute.
getter/setter pair
- packageInfo → PackageInfo?
-
The package info.
no setter
- packageName → String?
-
The 'Package Name' of the App.
no setter
- platform → TargetPlatform?
-
The running platform
no setter
-
routes
↔ Map<
String, WidgetBuilder> ? -
Returns the routes used by the App's View.
getter/setter pair
- scaffold → ScaffoldState
-
The Scaffold object for this App's View.
no setter
-
scaffoldMessengerKey
↔ GlobalKey<
ScaffoldMessengerState> ? -
Return the navigator key used by the App's View.
getter/setter pair
- 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?
-
If true, it turns on a performance overlay.
getter/setter pair
- showSemanticsDebugger ↔ bool?
-
Shows an overlay of accessibility information
getter/setter pair
-
state
→ AppState<
StatefulWidget> ? -
The App State object.
no setter
-
supportedLocales
↔ List<
Locale> ? -
getter, supportedLocales, returns a List of the App's locales.
More flexible than an iteration.
getter/setter pair
- themeData ↔ ThemeData?
-
The App's current Material theme.
getter/setter pair
- title ↔ String?
-
Returns the title for the App's View.
getter/setter pair
- turnedOffInternet → bool
-
Was on but now turned off connectivity
no setter
- turnedOnInternet → bool
-
Was off but now turned on connectivity
no setter
- useCupertino → bool
-
Indicates if the App is running the Cupertino interface theme.
no setter
- useMaterial → bool
-
Indicates if the App is running the Material interface theme.
no setter
- version → String?
-
The current version of the App.
no setter
-
widgetsAppKey
→ GlobalKey<
State< StatefulWidget> > -
Passed to the CupertinoApp or MaterialApp
final
Static Methods
-
addConnectivityListener(
ConnectivityListener? listener) → bool - Add a Connectivity listener.
-
buildInherited(
) → void - Rebuild dependencies to the root State object's InheritedWidget
-
catchError(
Object ex) → void - Catch and explicitly handle the error.
-
changeUI(
String ui) → void - Explicitly change to a particular interface.
-
dependOnInheritedWidget(
BuildContext? context) → void - Link a widget to a InheritedWidget in the root State object.
-
getDeviceInfo(
) → Future< void> - Collect the device's information.
-
getInstallNum(
) → Future< String?> - The id for this App's particular installation.
-
getMaterialColor(
Color color) → MaterialColor -
notifyClients(
) → void - same as above. Rebuild dependencies to the root State object's InheritedWidget
-
onError(
FlutterErrorDetails details) → void - App-level error handling.
-
refresh(
) → void - Refresh the 'current/latest' State object and 'root/first' State object.
-
removeConnectivityListener(
ConnectivityListener? listener) → bool - Remove a Connectivity listener.
-
setState(
VoidCallback fn) → void - Refresh the root State object with the passed function.
-
setThemeData(
{ColorSwatch< int?> ? swatch, Color? color}) → Color? - Set the App's general color theme supplying a Color value.
-
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 = DismissDirection.down}) → void - Display the SnackBar