paint method

  1. @override
void paint(
  1. Canvas canvas,
  2. Size size,
  3. double progress,
  4. int seed
)
override

Implementation

@override
void paint(Canvas canvas, Size size, double progress, int seed) {
  canvas.save();
  canvas.rotate(pi / 6);
  Path path = Path();
   /* for(int i = 0; i < segments; i++) {
      path.lineTo(curvyness * i, segmentLength * (i +1));
      path.lineTo(curvyness * (i + 1), segmentLength * (i + 1));
    }
    for(int i = segments - 1; i >= 0; i--) {
      path.lineTo(curvyness * (i + 1), segmentLength * i - curvyness);
      path.lineTo(curvyness * i, segmentLength * i - curvyness);
  }*/
  for(int i = 0; i < segments; i++) {
    path.quadraticBezierTo(curvyness * i, segmentLength * (i +1), curvyness * (i + 1), segmentLength * (i + 1));
  }
  for(int i = segments - 1; i >= 0; i--) {
    path.quadraticBezierTo(curvyness * (i + 1), segmentLength * i - curvyness, curvyness * i, segmentLength * i - curvyness);
  }
  path.close();
  canvas.drawPath(path, Paint()..color = color);
  canvas.restore();

}