units library

Unit value types without the Flutter widget runtime.

Build-time consumers use this entrypoint so they do not load dart:ui.

Classes

Em
A value relative to the effective em of the current element.
LengthUnit
A physical length that can be resolved in a typography context.
LengthUnitContext
Runtime values required to resolve relative length units.
Milliseconds
A duration expressed in milliseconds.
Px
An absolute logical-pixel value.
Rem
A value relative to the root rem configured for the widget subtree.
Seconds
A duration expressed in seconds.
TimeUnit
A physical time value that can be converted to a Dart Duration.
Unit
A typed physical UI quantity.

Extensions

UnitLiterals on num
Numeric literals for typed units.

Exceptions / Errors

MissingUnitContextException
Thrown when a relative unit lacks required runtime context.
UnitParseException
A parse failure with the source representation that caused it.