clipPathAndPaint method Null safety

void clipPathAndPaint(
  1. Path path,
  2. Clip clipBehavior,
  3. Rect bounds,
  4. VoidCallback painter
)

Clip canvas with Path according to Clip and then paint. canvas is restored to the pre-clip status afterwards.

bounds is the saveLayer bounds used for Clip.antiAliasWithSaveLayer.

Implementation

void clipPathAndPaint(Path path, Clip clipBehavior, Rect bounds, VoidCallback painter) {
  _clipAndPaint((bool doAntiAlias) => canvas.clipPath(path, doAntiAlias: doAntiAlias), clipBehavior, bounds, painter);
}