LedgerHost class

The one mount of Ledger. Picks the theme for the brightness in force, publishes it as a LedgerTheme, gives the platform primitives beneath the thin Material ThemeData they read, paints the ground behind the app, sets the body type as the default text style, carries status-bar polarity, and lets the reader's text size reach maxTextScale (200%): rows grow and wrap to it, and past it a page stands at 200% rather than break. Day to night (or one theme to another) the paper and the ink fade across in LedgerMotion.slow (AnimatedLedgerTheme); with reduced motion on they change at once. It hosts the toasts (LedgerToaster). 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(builder: (context, child) => LedgerHost(child: child!))
Inheritance

Constructors

LedgerHost({required Widget child, LedgerThemeData? light, LedgerThemeData? dark, Brightness? brightness, Key? key})
Mounts Ledger over child.
const

Properties

brightness → Brightness?
Pins the appearance; null follows the platform (or the preview frame).
final
child → Widget
The app.
final
dark → LedgerThemeData?
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 → LedgerThemeData?
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 Ledger 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(LedgerThemeData theme) → SystemUiOverlayStyle
The status bar's polarity over theme's ground.

Constants

maxTextScale → const double
The largest text scale a Ledger page lays out at: 200%, as WCAG's resize text asks.