Home > database >  Is there a ready-made library that does this widget in the picture
Is there a ready-made library that does this widget in the picture

Time:02-06

Is there a ready-made library that does this widget in the picture?enter image description here

CodePudding user response:

Yes, you can use syncfusion_flutter_sliders or RangeSlider from Flutter's material library

Example of syncfusion_flutter_sliders:

SfRangeValues _values = SfRangeValues(3.0, 7.0);

@override
Widget build(BuildContext context) {
  return MaterialApp(
      home: Scaffold(
          body: Center(
              child: SfRangeSlider.horizontal(
                    min: 0.0,
                    max: 10.0,
                    values: _values,
                    onChanged: (SfRangeValues newValues) {
                       setState(() {
                           _values = newValues;
                        });
                   },
              )
          )
      )
  );
}

Example of rangeSlider:

RangeValues values = RangeValues(1, 100);

RangeSlider(  
activeColor: Colors.red[700],
inactiveColor: Colors.red[300],
   min: 1,
    max: 100,
    values: values,
    onChanged: (values){
    setState(() {
      values =values;
    });
    }
),

CodePudding user response:

There is the Slider class.

Slider(
  value: _currentSliderValue,
  max: 100,
  divisions: 5,
  label: _currentSliderValue.round().toString(),
  onChanged: (double value) {
    setState(() {
      _currentSliderValue = value;
    });
  •  Tags:  
  • Related