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
| Name | Type | Default | Description |
|---|---|---|---|
color | HWColor? | null | Background fill. See HWColor. |
border | HWBoxBorder? | null | Border drawn around the child. |
HWDecoratedBox(
decoration: HWBoxDecoration(
color: HWColor.fixed(0xFF0000FF),
),
child: HWText.fixed('Hello World'),
)
HWBoxBorder
A simple, single-color rounded border.
| Name | Type | Default | Description |
|---|---|---|---|
color | HWColor | required | Stroke color. |
thickness | double | required | Stroke width. |
radius | double | 0.0 | Corner 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
- iOS — emitted as SwiftUI
.background(...)and.overlay(...)with aRoundedRectangle. - Android — emitted as a Glance
BoxusingbackgroundandcornerRadius.