draw method

  1. @override
void draw(
  1. Canvas canvas,
  2. double space,
  3. double width,
  4. double height,
  5. double radius,
  6. double cornerRadius,
)
override

This method will get body to class extending BasePainter and this method will draw the sliding indicator which slide over changing index.

Implementation

@override
void draw(Canvas canvas, double space, double width, double height,
    double radius, double cornerRadius) {
  canvas.drawRRect(
      RRect.fromRectAndRadius(
          Rect.fromCenter(
              center: Offset(radius + (page * (width + space)), radius),
              width: width,
              height: height),
          Radius.circular(cornerRadius)),
      _paint);
}