Fluent2Host class
The one mount of Fluent 2 in a host app. Picks the theme for the
brightness in force and puts it in scope with a Fluent2Theme (which
gives the platform primitives beneath the thin Material ThemeData they
read and sets Fluent's body1 as the default text style), paints the
page's ground behind the app, carries status-bar polarity, 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) => Fluent2Host(child: child!))
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- Fluent2Host
Constructors
- Fluent2Host({required Widget child, Fluent2ThemeData? light, Fluent2ThemeData? darkData, Brightness? brightness, Key? key})
-
Mounts Fluent 2 over
child.const
Properties
- brightness → Brightness?
-
Pins the appearance; null follows the platform (or the preview frame).
final
- child → Widget
-
The app under the host: its navigator and pages.
final
- darkData → Fluent2ThemeData?
-
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 → Fluent2ThemeData?
-
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 Fluent 2 raises what covers the
whole app (a sheet, a dialog, a menu, a toast): the outermost Navigator
between
contextand 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(
Fluent2ThemeData theme) → SystemUiOverlayStyle -
The status bar's polarity over
theme's ground.
Constants
- maxTextScale → const double
- The largest text scale a Fluent 2 page lays out at: twice the size, the 200% a reader may ask for (WCAG 1.4.4).