CssSpacing class sealed

CSS spacing value for margin and padding properties.

Supports all CSS shorthand syntaxes:

  • Single value: CssSpacing.all(CssLength.px(10))10px
  • Two values: CssSpacing.symmetric(vertical, horizontal)10px 20px
  • Three values: CssSpacing.only(top, horizontal, bottom)10px 20px 30px
  • Four values: CssSpacing.trbl(top, right, bottom, left)10px 20px 30px 40px
Implemented types

Constructors

CssSpacing.all(CssLength value)
Same value for all four sides.
factory
CssSpacing.global(CssGlobal global)
Global keyword (inherit, initial, unset, revert).
factory
CssSpacing.length(CssLength value)
Create from a single CssLength (convenience for migration).
factory
CssSpacing.only({required CssLength top, required CssLength horizontal, required CssLength bottom})
Three-value shorthand (top, horizontal, bottom).
factory
CssSpacing.raw(String value)
Raw CSS value escape hatch.
factory
CssSpacing.sides({CssLength? top, CssLength? right, CssLength? bottom, CssLength? left})
Create spacing from individual sides.
factory
CssSpacing.symmetric(CssLength vertical, CssLength horizontal)
Symmetric spacing (vertical and horizontal).
factory
CssSpacing.trbl(CssLength top, CssLength right, CssLength bottom, CssLength left)
Four-value shorthand (top, right, bottom, left).
factory
CssSpacing.variable(String varName)
CSS variable reference.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toCss() String
Converts this value to its CSS string representation.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

zero → const CssSpacing
Zero spacing.