background method

Modifier background(
  1. Color color
)

Wrap the widget into an Container Widget

Apply the color to the container Container

Implementation

Modifier background(Color color) {
  return Modifier._([
    ..._modifiers,
    (widget) {
      return Container(
        color: color,
        child: widget,
      );
    }
  ]);
}