units library
Unit value types without the Flutter widget runtime.
Build-time consumers use this entrypoint so they do not load dart:ui.
Classes
- AngleUnit
- A physical angle that can be converted without a rendering context.
- Degrees
- An angle expressed in degrees.
- Em
-
A value relative to the effective
emof 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.
- Radians
- An angle expressed in radians.
- Rem
-
A value relative to the root
remconfigured for the widget subtree. - Seconds
- A duration expressed in seconds.
- TimeUnit
- A physical time value that can be converted to a Dart Duration.
- Turns
- An angle expressed in complete turns.
- 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.