boeledi / RangeSlider

RangeSlider Widget for Flutter
Other
374 stars 67 forks source link

If both indicators are at the left most point they get stuck #5

Closed Haffi112 closed 5 years ago

Haffi112 commented 6 years ago

If I slide both indicators for the range picker to the left most point I cannot slide the right indicator back to the right.

I'm not sure if this is the intended behaviour but it looks like it could be better. My work around is to detect this and change the value of the right indicator if this happens.

raacker commented 6 years ago

It seems that if left and right thumb gets same value because of divisions (the README.md example also has), left thumb overlaps right thumb. Might try to work on this

boeledi commented 5 years ago

Hi, I just released version 1.1.0 which now "normally" corrects this behavior. Thanks for your contribution

Harteg commented 5 years ago

I am still have this problem on 1.1.0:

void main(){
  runApp(MaterialApp(
    title: "Test",
    home: Home(),
  ));
}

class Home extends StatefulWidget{
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {

  double lower = 0;
  double higher = 1000;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: RangeSlider(
          min: 0,
          max: 1000,
          divisions: 1000,
          lowerValue: lower,
          upperValue: higher,
          valueIndicatorMaxDecimals: 0,
          onChanged: (double newLower, double newHigher) {
            setState(() {
              lower = newLower;
              higher = newHigher;
            });
          },
        ),
      ),
    );
  }
}