paintMask method

void paintMask(
  1. Canvas canvas,
  2. Size size,
  3. ExtendedImageCropLayerPainter painter
)

draw crop layer lines

Implementation

void paintMask(
    Canvas canvas, Size size, ExtendedImageCropLayerPainter painter) {
  final Rect rect = Offset.zero & size;
  final Rect cropRect = painter.cropRect;
  final Color maskColor = painter.maskColor;
  canvas.saveLayer(rect, Paint());
  canvas.drawRect(
      rect,
      Paint()
        ..style = PaintingStyle.fill
        ..color = maskColor);
  canvas.drawRect(cropRect, Paint()..blendMode = BlendMode.clear);
  canvas.restore();
}