Skip to main content
The Stac EdgeInsets class represents padding or margin values. It specifies offsets in each of the four directions (left, top, right, bottom) in logical pixels.

Properties

PropertyTypeDescription
leftdouble?Left edge inset in logical pixels.
topdouble?Top edge inset in logical pixels.
rightdouble?Right edge inset in logical pixels.
bottomdouble?Bottom edge inset in logical pixels.

Constructors

All Edges Equal

StacEdgeInsets.all(16.0)

Symmetric (Horizontal/Vertical)

StacEdgeInsets.symmetric(
  horizontal: 16.0,
  vertical: 8.0,
)

Only Specific Edges

StacEdgeInsets.only(
  left: 8.0,
  top: 16.0,
  right: 8.0,
  bottom: 24.0,
)

Horizontal Only

StacEdgeInsets.horizontal(16.0)

Vertical Only

StacEdgeInsets.vertical(16.0)

Example Usage

With Padding Widget

StacPadding(
  padding: StacEdgeInsets.all(16.0),
  child: StacText(data: 'Padded content'),
)

With Container

StacContainer(
  padding: StacEdgeInsets.symmetric(
    horizontal: 24.0,
    vertical: 16.0,
  ),
  margin: StacEdgeInsets.only(bottom: 8.0),
  child: StacText(data: 'Container content'),
)