onDraw method

  1. @override
void onDraw(
  1. Canvas canvas
)
override

Draws the slices, the highlighted slices, the hole and the center text, the values and labels, the legend, the description and the markers, in that order, or the empty state while there is nothing to draw.

Implementation

@override
void onDraw(ui.Canvas canvas) {
  super.onDraw(canvas);

  if (showsEmptyState) return;

  renderer.drawData(canvas);

  final highlighted = this.highlighted;
  if (valuesToHighlight()) renderer.drawHighlighted(canvas, highlighted);

  renderer.drawExtras(canvas);

  renderer.drawValues(canvas);

  legendRenderer.renderLegend(canvas);

  drawDescription(canvas);

  drawMarkers(canvas);

  notifyAfterDraw();
}