LedgerDensity class final

How tightly Ledger sets its controls and rows: the one size setting the look has, in Flutter's words for density. standard is the touch size the look is drawn at (a 48 button, a 48 field, a 52 row); comfortable takes 4 off each, compact 8. Every part that takes a line height reads its height here, so a field, a select and a button that share a line keep one height at every density.

The default, adaptivePlatformDensity, is compact under a pointer (macOS, Windows, Linux) and standard on touch. A tap target stays 44 at every density: what shrinks is the drawn face, never the reach.

LedgerTheme(
  data: LedgerThemeData.light().copyWith(density: LedgerDensity.compact),
  child: page,
)
Mixed-in types
Annotations

Properties

hashCode → int
The hash code for this object.
no setteroverride
name → String
The density's name: standard, comfortable or compact.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
step → int
Steps from standard: 0, -1 or -2.
final

Methods

debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
height(double base, {double floor = 24}) → double
base (a standard height) at this density: 4 off per step, never under floor.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
padding(double base) → double
base (a standard padding) at this density: 2 off per step, never under 0.
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
toStringShort() → String
A brief description of this object, usually just the runtimeType and the hashCode.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Properties

adaptivePlatformDensity → LedgerDensity
The density for the platform the app runs on (defaultTargetPlatform), as Flutter's adaptivePlatformDensity is.
no setter

Static Methods

defaultDensityForPlatform(TargetPlatform platform) → LedgerDensity
The density for platform: compact under a pointer (macOS, Windows, Linux), standard on touch (Android, iOS, Fuchsia).

Constants

comfortable → const LedgerDensity
One step tighter: 4 off every control and row.
compact → const LedgerDensity
Two steps tighter: 8 off every control and row; what a desktop wants.
standard → const LedgerDensity
The touch size the look is drawn at.
stepSize → const double
The pixels one step takes off a control or a row.
values → const List<LedgerDensity>
Every density, loosest first.