void clipRect(Rect rect, { ClipOp clipOp: ClipOp.intersect })

Reduces the clip region to the intersection of the current clip and the given rectangle.

If the clip is not axis-aligned with the display device, and isAntiAlias is true, then the clip will be anti-aliased. If multiple draw commands intersect with the clip boundary, this can result in incorrect blending at the clip boundary. See saveLayer for a discussion of how to address that.

Use ClipOp.difference to subtract the provided rectangle from the current clip.

Source

void clipRect(Rect rect, { ClipOp clipOp: ClipOp.intersect }) {
  assert(_rectIsValid(rect));
  assert(clipOp != null);
  _clipRect(rect.left, rect.top, rect.right, rect.bottom, clipOp.index);
}