HWBoxDecoration

Background color and border for HWDecoratedBox.

HWBoxDecoration

HWBoxDecoration describes how an HWDecoratedBox paints behind and around its child. Both fields are optional — leave them null to skip that layer.

Parameters

NameTypeDefaultDescription
colorHWColor?nullBackground fill. See HWColor.
borderHWBoxBorder?nullBorder drawn around the child.
HWDecoratedBox(
  decoration: HWBoxDecoration(
    color: HWColor.fixed(0xFF0000FF),
  ),
  child: HWText.fixed('Hello World'),
)

HWBoxBorder

A simple, single-color rounded border.

NameTypeDefaultDescription
colorHWColorrequiredStroke color.
thicknessdoublerequiredStroke width.
radiusdouble0.0Corner radius applied to both border and background.
HWDecoratedBox(
  decoration: HWBoxDecoration(
    color: HWColor.fixed(0xFFFFFFFF),
    border: HWBoxBorder(
      color: HWDefaultColor(HWColorRole.contentAccent),
      thickness: 2.0,
      radius: 12.0,
    ),
  ),
  child: HWText.fixed('Bordered'),
)

Glance does not expose stroke alignment, so on Android the border is approximated as an inside border (an outer Box providing the stroke, with the child inset by thickness).

Platform mapping