draw method

  1. @override
void draw(
  1. Canvas canvas,
  2. FlSpot spot,
  3. Offset offsetInCanvas
)
override

Implementation of the parent class to draw the square

Implementation

@override
void draw(Canvas canvas, FlSpot spot, Offset offsetInCanvas) {
  if (strokeWidth != 0.0 && strokeColor.opacity != 0.0) {
    canvas.drawRect(
      Rect.fromCircle(
        center: offsetInCanvas,
        radius: (size / 2) + (strokeWidth / 2),
      ),
      Paint()
        ..color = strokeColor
        ..strokeWidth = strokeWidth
        ..style = PaintingStyle.stroke,
    );
  }
  canvas.drawRect(
    Rect.fromCircle(
      center: offsetInCanvas,
      radius: size / 2,
    ),
    Paint()
      ..color = color
      ..style = PaintingStyle.fill,
  );
}