paint method

  1. @override
void paint(
  1. Canvas canvas,
  2. Size size
)
override

Paints the shape on the given canvas.

This method must be implemented by all concrete shape painters. It should handle the actual drawing logic for the specific shape.

canvas is the canvas to paint on. size is the size of the canvas.

Implementation

@override
void paint(Canvas canvas, Size size) {
  if (applyAfter) {
    // Draw the base painter first
    basePainter.paint(canvas, size);

    // Then draw the shadow
    _drawShadow(canvas, size);
  } else {
    // Draw the shadow first
    _drawShadow(canvas, size);

    // Then draw the base painter
    basePainter.paint(canvas, size);
  }
}