WidgetsApp class

A convenience class that wraps a number of widgets that are commonly required for an application.

One of the primary roles that WidgetsApp provides is binding the system back button to popping the Navigator or quitting the application.

See also: CheckedModeBanner, DefaultTextStyle, MediaQuery, Localizations, Title, Navigator, Overlay, SemanticsDebugger (the widgets wrapped by this one).

Inheritance

Constructors

WidgetsApp({Key key, GlobalKey<NavigatorState> navigatorKey, RouteFactory onGenerateRoute, RouteFactory onUnknownRoute, List<NavigatorObserver> navigatorObservers: const [], String initialRoute, PageRouteFactory pageRouteBuilder, Widget home, Map<String, WidgetBuilder> routes: const {}, TransitionBuilder builder, String title: '', GenerateAppTitle onGenerateTitle, TextStyle textStyle, @required Color color, Locale locale, Iterable<LocalizationsDelegate> localizationsDelegates, LocaleResolutionCallback localeResolutionCallback, Iterable<Locale> supportedLocales: const [Locale('en', 'US')], bool showPerformanceOverlay: false, bool checkerboardRasterCacheImages: false, bool checkerboardOffscreenLayers: false, bool showSemanticsDebugger: false, bool debugShowWidgetInspector: false, bool debugShowCheckedModeBanner: true, InspectorSelectButtonBuilder inspectorSelectButtonBuilder })
Creates a widget that wraps a number of widgets that are commonly required for an application. [...]

Properties

builder TransitionBuilder
final
checkerboardOffscreenLayers → bool
Checkerboards layers rendered to offscreen bitmaps. [...]
final
checkerboardRasterCacheImages → bool
Checkerboards raster cache images. [...]
final
color Color
final
debugShowCheckedModeBanner → bool
final
debugShowWidgetInspector → bool
Turns on an overlay that enables inspecting the widget tree. [...]
final
home Widget
{@template flutter.widgets.widgetsApp.home} The widget for the default route of the app (Navigator.defaultRouteName, which is /). [...]
final
initialRoute → String
final
inspectorSelectButtonBuilder InspectorSelectButtonBuilder
Builds the widget the WidgetInspector uses to switch between view and inspect modes. [...]
final
locale Locale
final
localeResolutionCallback LocaleResolutionCallback
See also: [...]
final
localizationsDelegates → Iterable<LocalizationsDelegate>
final
{@template flutter.widgets.widgetsApp.navigatorKey} A key to use when building the Navigator. [...]
final
final
onGenerateRoute RouteFactory
If this property is not set, either the routes or home properties must be set, and the pageRouteBuilder must also be set so that the default handler will know what routes and PageRoutes to build.
final
onGenerateTitle GenerateAppTitle
final
onUnknownRoute RouteFactory
final
pageRouteBuilder PageRouteFactory
The PageRoute generator callback used when the app is navigated to a named route. [...]
final
routes → Map<String, WidgetBuilder>
The application's top-level routing table. [...]
final
showPerformanceOverlay → bool
Turns on a performance overlay. [...]
final
showSemanticsDebugger → bool
Turns on an overlay that shows the accessibility information reported by the framework.
final
supportedLocales → Iterable<Locale>
See also: [...]
final
textStyle TextStyle
The default text style for Text in the application.
final
title → String
final
hashCode → int
The hash code for this object. [...]
read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createState() → _WidgetsAppState
Creates the mutable state for this widget at a given location in the tree. [...]
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toDiagnosticsNode({String name, DiagnosticsTreeStyle style }) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by toStringDeep. [...]
inherited
toString({DiagnosticLevel minLevel: DiagnosticLevel.debug }) → String
Returns a string representation of this object.
inherited
toStringDeep({String prefixLineOne: '', String prefixOtherLines, DiagnosticLevel minLevel: DiagnosticLevel.debug }) → String
Returns a string representation of this node and its descendants. [...]
inherited
toStringShallow({String joiner: ', ', DiagnosticLevel minLevel: DiagnosticLevel.debug }) → String
Returns a one-line detailed description of the object. [...]
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited

Static Properties

debugAllowBannerOverride ↔ bool
If false, prevents the debug banner from being visible. [...]
read / write
debugShowWidgetInspectorOverride ↔ bool
If true, forces the widget inspector to be visible. [...]
read / write
showPerformanceOverlayOverride ↔ bool
If true, forces the performance overlay to be visible in all instances. [...]
read / write