paint method

void paint (Canvas canvas, Rect rect)

Paints the thumb onto the given canvas in the given rectangle.

Consider using radius and extension when deciding how large a rectangle to use for the thumb.


void paint(Canvas canvas, Rect rect) {
  final RRect rrect = RRect.fromRectAndRadius(
    Radius.circular(rect.shortestSide / 2.0),

  canvas.drawRRect(rrect, _shadowPaint);
  canvas.drawRRect(rrect.shift(const Offset(0.0, 3.0)), _shadowPaint);
  canvas.drawRRect(rrect, Paint()..color = color);