paintWithFill method

void paintWithFill(
  1. Canvas canvas,
  2. Paint fill
)

Paints the graphics with the specified fill on the given canvas.

If the graphics contains a picture, it will be drawn instead of the path. Otherwise, the path will be filled with the provided fill paint. This method skips drawing if the graphics is not visible.

Implementation

void paintWithFill(Canvas canvas, Paint fill) {
  if (!_isVisible) {
    return;
  }
  for (var graph in _drawingQueue) {
    if (graph!.hasPicture) {
      canvas.drawPicture(graph.picture!);
      return;
    }
    canvas.drawPath(graph.path!, fill);
  }
}