EdgeSpacing class
Defines spacing values for all four edges of a rectangle.
This class represents absolute spacing from each edge (left, top, right, bottom). The spacing values are resolved to actual pixel values during layout.
Use this for spacing that doesn't depend on text direction, or when you need explicit control over left/right spacing (like padding or margins).
- Inheritance
-
- Object
- EdgeSpacingGeometry
- EdgeSpacing
Constructors
- EdgeSpacing.all(SpacingUnit value)
-
Creates an EdgeSpacing with the same value for all edges.
const
- EdgeSpacing.only({SpacingUnit left = SpacingUnit.zero, SpacingUnit right = SpacingUnit.zero, SpacingUnit top = SpacingUnit.zero, SpacingUnit bottom = SpacingUnit.zero})
-
Creates an EdgeSpacing with individual edge values.
const
- EdgeSpacing.symmetric({SpacingUnit horizontal = SpacingUnit.zero, SpacingUnit vertical = SpacingUnit.zero})
-
Creates an EdgeSpacing with symmetric horizontal and vertical values.
const
Properties
- bottom → SpacingUnit
-
The spacing from the bottom edge.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- left → SpacingUnit
-
The spacing from the left edge.
final
- right → SpacingUnit
-
The spacing from the right edge.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- top → SpacingUnit
-
The spacing from the top edge.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
LayoutTextDirection direction) → EdgeSpacing -
Returns this EdgeSpacing as-is since it's already absolute.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
lerp(
EdgeSpacing a, EdgeSpacing b, double t) → EdgeSpacing - Linearly interpolates between two EdgeSpacing instances.
Constants
- zero → const EdgeSpacing
- Zero spacing for all edges.