draw method
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());
}