clear abstract method

void clear([
  1. Rect? target
])

Clears the buffer to the PixelFormat.zero value.

This is equivalent to calling fill with the zero value of the format.

If a target rectangle is provided, only the pixels within that rectangle will be cleared, and the rectangle will be clipped to the bounds of the buffer. If omitted, the entire buffer will be cleared.

Example

final pixels = IntPixels(2, 2);
pixels.clear();
pixels.clear(Rect.fromLTWH(1, 0, 1, 2));

Implementation

void clear([Rect? target]);