HWDecoratedBox

Decorate a child with a background color and/or border.

HWDecoratedBox

Wraps a child with an HWBoxDecoration — an optional HWColor background and an optional HWBoxBorder. For a plain solid fill, prefer HWColoredBox.

HWDecoratedBox(
  decoration: HWBoxDecoration(
    color: HWColor.fixed(0xFF222222),
    border: HWBoxBorder(
      radius: 12,
      thickness: 1,
      color: HWColor.fixed(0xFFFFFFFF),
    ),
  ),
  child: HWText.fixed('Boxed'),
)

HWBoxBorder requires thickness and color; radius defaults to 0. Glance does not expose stroke alignment, so borders are emitted as an inside-border approximation on Android.

Parameters

HWDecoratedBox

NameTypeDefaultDescription
childHWWidgetrequiredWidget being decorated.
decorationHWBoxDecorationrequiredBackground color and/or border.

HWBoxDecoration

NameTypeDefaultDescription
colorHWColor?nullBackground color.
borderHWBoxBorder?nullBorder specification.

HWBoxBorder

NameTypeDefaultDescription
radiusdouble0.0Corner radius applied to the border.
thicknessdoublerequiredBorder width.
colorHWColorrequiredBorder color.

Platform mapping