dragMode property
Represents the behavior of thumb dragging in the SfRangeSlider.
When dragMode is set to SliderDragMode.onThumb, individual thumb can be moved by dragging it.
When dragMode is set to SliderDragMode.betweenThumbs, both the thumbs can be moved at the same time by dragging in the area between start and end thumbs. The range between the start and end thumb will always be the same. Hence, it is not possible to move the individual thumb.
When dragMode is set to SliderDragMode.both, individual thumb can be moved by dragging it, and also both the thumbs can be moved at the same time by dragging in the area between start and end thumbs.
Defaults to SliderDragMode.onThumb.
This code snippet shows the behavior of thumb dragging.
SfRangeValues _values = SfRangeValues(4.0, 8.0);
SfRangeSlider(
min: 0.0,
max: 10.0,
interval: 2,
showLabels: true,
dragMode: SliderDragMode.betweenThumbs,
values: _values,
onChanged: (SfRangeValues newValues) {
setState(() {
_values = newValues;
});
}
)
See also:
- The enableIntervalSelection, to select the particular interval based on the position of the tap or click.
Implementation
final SliderDragMode dragMode;