ThemedApp class
A drop-in replacement for MaterialApp that automatically handles theme changes.
ThemedApp wraps MaterialApp and listens to Themed for theme updates. All standard MaterialApp parameters are supported.
Important: Do not set MaterialApp.theme or MaterialApp.darkTheme manually, as Themed controls these automatically.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ThemedApp
Constructors
-
ThemedApp({Key? key, required String title, String? fontFamily, Widget? home, Map<
String, WidgetBuilder> ? routes, String? initialRoute, RouteFactory? onGenerateRoute, RouteFactory? onUnknownRoute, TransitionBuilder? builder, Locale? locale, Iterable<LocalizationsDelegate> ? localizationsDelegates, Iterable<Locale> ? supportedLocales = const <Locale>[Locale('en')], bool debugShowCheckedModeBanner = true, bool debugShowMaterialGrid = false, bool showPerformanceOverlay = false, bool checkerboardRasterCacheImages = false, bool checkerboardOffscreenLayers = false, bool showSemanticsDebugger = false}) -
const
Properties
- builder → TransitionBuilder?
-
A builder that can wrap the app's widgets.
final
- checkerboardOffscreenLayers → bool
-
Whether to checkerboard offscreen layers.
final
- checkerboardRasterCacheImages → bool
-
Whether to checkerboard raster cache images.
final
- debugShowCheckedModeBanner → bool
-
Whether to show the debug banner in debug mode.
final
- debugShowMaterialGrid → bool
-
Whether to show the material grid in debug mode.
final
- fontFamily → String?
-
Optional font family to apply to all text in the theme.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- home → Widget?
-
The widget for the default route of the app.
final
- initialRoute → String?
-
The name of the first route to show.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- locale → Locale?
-
The locale for this app.
final
-
localizationsDelegates
→ Iterable<
LocalizationsDelegate> ? -
The delegates for this app's localization.
final
-
The list of observers for the Navigator created for this app.
final
- onGenerateRoute → RouteFactory?
-
The route generator callback for when routes doesn't contain a route.
final
- onUnknownRoute → RouteFactory?
-
Called when onGenerateRoute fails to generate a route.
final
-
routes
→ Map<
String, WidgetBuilder> ? -
The application's top-level routing table.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showPerformanceOverlay → bool
-
Whether to show the performance overlay.
final
- showSemanticsDebugger → bool
-
Whether to show the semantics debugger.
final
-
supportedLocales
→ Iterable<
Locale> ? -
The list of locales that this app has been localized for.
final
- title → String
-
The title of the application.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent 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 DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → 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 ==(
Object other) → bool -
The equality operator.
inherited