CustomPaint constructor Null safety

const CustomPaint(
  1. {Key? key,
  2. CustomPainter? painter,
  3. CustomPainter? foregroundPainter,
  4. Size size = Size.zero,
  5. bool isComplex = false,
  6. bool willChange = false,
  7. Widget? child}
)

Creates a widget that delegates its painting.

Implementation

const CustomPaint({
  super.key,
  this.painter,
  this.foregroundPainter,
  this.size = Size.zero,
  this.isComplex = false,
  this.willChange = false,
  super.child,
}) : assert(size != null),
     assert(isComplex != null),
     assert(willChange != null),
     assert(painter != null || foregroundPainter != null || (!isComplex && !willChange));