draw method

  1. @override
void draw(
  1. Canvas canvas,
  2. double space,
  3. double size,
  4. double radius,
)
override

Implementation

@override
void draw(Canvas canvas, double space, double size, double radius) {
  double secondOffset = index == widget.count - 1
      ? radius
      : radius + ((index + 1) * (size + space));

  double progress = page - index;
  _paint.color = Color.lerp(widget.activeColor, widget.color, progress)!;
  //last
  canvas.drawCircle(new Offset(radius + (index * (size + space)), radius),
      lerp(radius, radius * widget.scale, progress), _paint);
  //first
  _paint.color = Color.lerp(widget.color, widget.activeColor, progress)!;
  canvas.drawCircle(new Offset(secondOffset, radius),
      lerp(radius * widget.scale, radius, progress), _paint);
}