FrostedHost class

The one mount of Frosted in an app: picks the theme for the brightness in force and publishes it as a FrostedTheme (which installs what the platform's widgets under it read; a change of brightness or theme eases through AnimatedFrostedTheme), paints the ground behind the app, carries status-bar polarity, holds the toasts (FrostedToast.show) over the app, and clamps the text scale at maxTextScale so a large accessibility size grows rows rather than breaking them. Every render host mounts it once above its Navigator: the app in its router builder, a page preview in its own.

The host follows the ambient platform for behaviour (scroll physics, text selection, back gestures) and never pins one; inside a preview frame it follows the frame's register.

MaterialApp.router(routerConfig: router, builder: (context, child) => FrostedHost(child: child!))
Inheritance

Constructors

FrostedHost({required Widget child, FrostedThemeData? light, FrostedThemeData? dark, Brightness? brightness, Key? key})
Creates a FrostedHost.
const

Properties

brightness → Brightness?
Pins the appearance; null follows the platform (or the preview frame).
final
child → Widget
The app.
final
dark → FrostedThemeData?
The dark theme; null is the default preset's.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
light → FrostedThemeData?
The light theme; null is the default preset's.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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.
override
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

Static Methods

The app's own root navigator, where Frosted raises what covers the whole app (a sheet, a dialog, a menu, a toast): the outermost Navigator between context and the host above it. A render host that nests the app under a navigator of its own (a preview frame) stays outside, so what the app mounts above its navigator (its provider scope, its router) reaches the route. With no navigator below the host (a page preview), the nearest one.
systemBarsOf(FrostedThemeData theme) → SystemUiOverlayStyle
The status bar's polarity over theme's ground.

Constants

maxTextScale → const double
The largest text scale a Frosted page lays out at: 200%, as WCAG's resize-text criterion asks; a larger accessibility size lays out at this.