paint method

  1. @override
void paint(
  1. Context context
)
override

Draw itself and its children, according to the calculated box.offset

Implementation

@override
void paint(Context context) {
  super.paint(context);

  final canvas = context.canvas;

  canvas.saveContext();

  if (fillColor != null) {
    canvas.setFillColor(fillColor!);
  }
  if (strokeColor != null) {
    canvas.setStrokeColor(strokeColor);
  }

  canvas.setLineWidth(strokeWidth);

  canvas.drawEllipse(
      box!.width / 2, box!.height / 2, box!.width / 2, box!.height / 2);

  if (strokeColor != null && fillColor != null) {
    canvas.fillAndStrokePath();
  } else if (strokeColor != null) {
    canvas.strokePath();
  } else {
    canvas.fillPath();
  }

  canvas.restoreContext();
}