Skip to content

Instantly share code, notes, and snippets.

@GursheeshSingh
Created December 14, 2019 19:51
Show Gist options
  • Save GursheeshSingh/0b8dc3a1ccea487e8ef9d58b64c4f3b9 to your computer and use it in GitHub Desktop.
Save GursheeshSingh/0b8dc3a1ccea487e8ef9d58b64c4f3b9 to your computer and use it in GitHub Desktop.
class MySlider extends StatefulWidget {
@override
_MySliderState createState() => _MySliderState();
}
class _MySliderState extends State<MySlider> {
double _value = 0.5;
@override
Widget build(BuildContext context) {
return SliderTheme(
data: SliderTheme.of(context).copyWith(
thumbShape: RoundSliderThumbShape()
),
child: Slider(
value: _value,
onChanged: (newValue){
setState(() {
_value = newValue;
});
},
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment