customPaint method

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

A widget that provides a canvas on which to draw during the paint phase.

Implementation

Widget customPaint({
  required CustomPainter painter,
  Key? key,
  CustomPainter? foregroundPainter,
  Size size = Size.zero,
  bool isComplex = false,
  bool willChange = false,
}) {
  return CustomPaint(
    key: key,
    painter: painter,
    foregroundPainter: foregroundPainter,
    size: size,
    isComplex: isComplex,
    willChange: willChange,
    child: this,
  );
}