Skip to content

Instantly share code, notes, and snippets.

@GursheeshSingh
Last active December 14, 2019 20:29
Show Gist options
  • Save GursheeshSingh/e1f5772fd63518fd452c7278edcf79be to your computer and use it in GitHub Desktop.
Save GursheeshSingh/e1f5772fd63518fd452c7278edcf79be to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class CircleThumbShape extends SliderComponentShape {
final double thumbRadius;
const CircleThumbShape({
this.thumbRadius = 6.0,
});
@override
Size getPreferredSize(bool isEnabled, bool isDiscrete) {
return Size.fromRadius(thumbRadius);
}
@override
void paint(PaintingContext context, Offset center, {Animation<double> activationAnimation, Animation<double> enableAnimation, bool isDiscrete, TextPainter labelPainter, RenderBox parentBox, SliderThemeData sliderTheme, TextDirection textDirection, double value}) {
// We need to draw the thumb here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment