draw method

  1. @override
void draw(
  1. Canvas canvas,
  2. Rect bounds
)
override

Draws the contents or children of this Drawable to the canvas, using the parentPaint to optionally override the child's paint.

The bounds specify the area to draw in.

Implementation

@override
void draw(Canvas canvas, Rect bounds) {
  if (!hasDrawableContent) {
    return;
  }
  if (transform != null) {
    canvas.save();
    canvas.transform(transform!);
  }
  if (fill != null) {
    canvas.drawParagraph(fill!, resolveOffset(fill!, anchor, offset));
  }
  if (stroke != null) {
    canvas.drawParagraph(stroke!, resolveOffset(stroke!, anchor, offset));
  }
  if (transform != null) {
    canvas.restore();
  }
}