or example, this <code>CustomPainter.paint</code> method paints a clean white
rounded rectangle:</p>
<pre class="language-dart"><code class="language-dart">void paint(Canvas canvas, Size size) {
  Rect rect = Offset.zero &amp; size;
  canvas.save();
  canvas.clipRRect(new RRect.fromRectXY(rect, 100.0, 100.0));
  canvas.saveLayer(rect, Paint());
  canvas.drawPaint(new Paint()..color = Colors.red);
  canvas.drawPaint(new Paint()..color = Colors.white);
  canvas.restore();
  canvas.restore();
}
</code></pre>
<