backgroundColor method

Widget backgroundColor(
  1. Color color, {
  2. bool handover = true,
})

A modifier that sets its widget's backgruond color

Example:

Text('Black text')
    .backgroundColor(Colors.white)

Implementation

Widget backgroundColor(Color color, {bool handover = true}) {
  if (handover && this is Container) {
    return (this as Container).backgroundColor(color);
  }
  return Container(child: this, color: color);
}