paint method

  1. @override
dynamic paint(
  1. Canvas canvas,
  2. Paint? paint,
  3. Size size
)
override

Implementation

@override
paint(Canvas canvas, Paint? paint, Size size) {
  var x = size.width / 2;
  var y = size.height / 2;

  canvas.save();

  canvas.translate(x, y);
  canvas.rotate(degrees1);
  paint!.color = paint.color.withAlpha(255);
  Rect rectF1 = Rect.fromLTRB(-x / 1.7, -y / 1.7, x / 1.7, y / 1.7);
  canvas.drawArc(rectF1, 0, 270, false, paint);

  canvas.restore();

  canvas.save();
  canvas.translate(x, y);
  canvas.rotate(degrees2);
  paint.color = paint.color.withAlpha(255);
  Rect rectF2 = Rect.fromLTRB(-x / 1.7, -y / 1.7, x / 1.7, y / 1.7);
  canvas.drawArc(rectF2, 90, 270, false, paint);
  canvas.restore();

  var radius = size.width / 11;
  paint.color = paint.color.withAlpha(alpha);
  canvas.drawCircle(
      Offset((1 - translateX) * size.width, size.height / 2), radius, paint);
}