flutter_xlider
flutter_xlider copied to clipboard
Support defining the value of the slider
With a Slider
, we're required to supply a value. This allows us to start at any point in the slider. I wasn't able to find that property with this widget. Can that be added?
Hi. Sorry, I didn’t quite understand what you mean. Could you provide more details? Thanks
If you look at the constructor for a Slider
you'll see a value property...
Oh, wait. Is that what values
is for? But it's a list because it might need to be a range slider?
Yes, values
with a single value is what you want.
Got it. Thanks. Could you look into splitting this into 2 widgets? That way we can move all the parameters that don't make sense for a single slider out into a new class
Also, if values
is of type List<double>
, then why are the function definitions for the dragging using dynamic? Sometimes it puts out an integer and sometimes it puts out an empty String
final Function(int handlerIndex, dynamic lowerValue, dynamic upperValue)
onDragStarted;
final Function(int handlerIndex, dynamic lowerValue, dynamic upperValue)
onDragCompleted;
final Function(int handlerIndex, dynamic lowerValue, dynamic upperValue)
onDragging;
because slider only works with double numbers but you may have custom values in output. For example take a look at fixed values
section in the docs. The output can be anything.