Unit class abstract
Represents a CSS unit value.
This can be used to specify lengths, sizes, and other measurements in CSS.
Read more: MDN CSS Values and Units
Constructors
- Unit.em(double value)
-
Constructs a Unit in the form '100em'
constfactory
- Unit.expression(String expression)
-
Constructs a Unit from a custom css expression.
constfactory
- Unit.percent(double value)
-
Constructs a Unit in the form '100%'
constfactory
- Unit.pixels(double value)
-
Constructs a Unit in the form '100px'
constfactory
- Unit.points(double value)
-
Constructs a Unit in the form '100pt'
constfactory
- Unit.rem(double value)
-
Constructs a Unit in the form '100rem'
constfactory
- Unit.variable(String value)
-
Represents a css variable
constfactory
- Unit.vh(double value)
-
Constructs a Unit in the form '100vh'
constfactory
- Unit.vw(double value)
-
Constructs a Unit in the form '100vw'
constfactory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- auto → const Unit
- The style attribute unit 'auto'
- fitContent → const Unit
- The fit-content keyword means that the box will use the available space, but never more than max-content.
- inherit → const Unit
- initial → const Unit
- maxContent → const Unit
- The max-content sizing keyword represents the maximum intrinsic size of the content. For text content this means that the content will not wrap at all even if it causes overflows.
- minContent → const Unit
- The min-content sizing keyword represents the minimum intrinsic size of the content. For text content this means that the content will take all soft-wrapping opportunities, becoming as small as the longest word.
- revert → const Unit
- revertLayer → const Unit
- unset → const Unit
- zero → const Unit