clearRect method

void clearRect(
  1. double x,
  2. double y,
  3. double w,
  4. double h,
)

Implementation

void clearRect(double x, double y, double w, double h) {
  Rect rect = Rect.fromLTWH(x, y, w, h);
  addAction((Canvas canvas, Size size) {
    // Must saveLayer before clear avoid there is a "black" background
    Paint paint = Paint()
      ..style = PaintingStyle.fill
      ..blendMode = BlendMode.clear;
    canvas.drawRect(rect, paint);
  });
}