HWColoredBox

Paint a child with a solid background color.

HWColoredBox

Paints its area with a single HWColor and renders a child on top. For backgrounds with a border or rounded corners use HWDecoratedBox.

HWFill(
  child: HWColoredBox(
    color: HWColor.fixed(0xFF0000FF),
    child: HWFill(
      child: HWColumn(
        children: [
          HWText.fixed('No Color'),
          HWText.fixed(
            'Fixed Color',
            style: HWTextStyle(color: HWFixedColor(0xFFFF0000)),
          ),
          HWText.fixed(
            'Themed',
            style: HWTextStyle(
              color: HWThemedColor(
                light: HWFixedColor(0xFFFFFF00),
                dark: HWFixedColor(0xFF00FFFF),
              ),
            ),
          ),
        ],
      ),
    ),
  ),
)

The color accepts any HWColor — a fixed ARGB value, a themed light/dark pair, or a system role. See HWColor.

Parameters

NameTypeDefaultDescription
childHWWidgetrequiredThe widget painted on top of the color.
colorHWColorrequiredThe background color (fixed or themed).

Platform mapping