ColoredBox constructor Null safety

const ColoredBox(
  1. {required Color color,
  2. Widget? child,
  3. Key? key}
)

Creates a widget that paints its area with the specified Color.

The color parameter must not be null.

Implementation

const ColoredBox({ required this.color, super.child, super.key })
    : assert(color != null);