draw method

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

Draws the image on the provided canvas of size size.

Implementation

@override
void draw(Canvas canvas, Size size) {
  // Draw the image onto the canvas.
  canvas.drawImageRect(
      image,
      Rect.fromPoints(Offset.zero,
          Offset(image.width.toDouble(), image.height.toDouble())),
      Rect.fromPoints(Offset.zero, Offset(size.width, size.height)),
      Paint());
}