drawImageRect abstract method

void drawImageRect({
  1. Image? image,
  2. Rect? source,
  3. Rect? destination,
  4. Color? color,
  5. double? strokeWidth,
  6. bool? hasMaskFilter,
  7. PaintingStyle? style,
})

Indicates that an image subsection is expected next.

The next call to Canvas.drawImageRect is examined, and its arguments compared to those passed to this method.

If no call to Canvas.drawImageRect was made, then this results in failure.

Any calls made between the last matched call (if any) and the Canvas.drawImageRect call are ignored.

The Paint-related arguments (color, strokeWidth, hasMaskFilter, style) are compared against the state of the Paint object after the painting has completed, not at the time of the call. If the same Paint object is reused multiple times, then this may not match the actual arguments as they were seen by the method.

Implementation

void drawImageRect({ ui.Image? image, Rect? source, Rect? destination, Color? color, double? strokeWidth, bool? hasMaskFilter, PaintingStyle? style });