matthewfx / sleek_circular_slider

Sleek circular slider for Flutter
MIT License
524 stars 102 forks source link

How to configure step of the Slider? #38

Closed eli1stark closed 3 years ago

matthewfx commented 4 years ago

Hi Eli, What do you mean by the step?

eli1stark commented 4 years ago

Hello, suppose I have 15 elements in the slider and onChange I want to go from 0 to 5, from 5 to 10, and from 10 to 15. So, the step is 5. Right now step is not configurable and instead, the function on change returns precise double something like that: 1.7942942. I found a way around it. I need instead of 15 elements use 3, and onChange: (value) => value.ceil() * 5. But it would be nice if the slider was discrete and returning integers. Otherwise, the package is great! Looking forward to the second handle for the interval selection feature👍.

matthewfx commented 3 years ago

I think the way you've done it is the right way. If I wanted to add all possible features to the slider its interface and documentation would become huge and complex. That's why I prefer to focus only on features for which can't be added externally. Thank you very much for your feedback!

sercan-uzun commented 2 years ago

Hello, also I want to use return integer. Because I am using .coil() but sometime is not matching same as shown. On the other hand, onchange function is generating a lot of value when this.