onChangeStart property

ValueChanged<double> onChangeStart
final

Called when the user starts selecting a new value for the slider.

This callback shouldn't be used to update the slider value (use onChanged for that), but rather to be notified when the user has started selecting a new value by starting a drag.

The value passed will be the last value that the slider had before the change began.

CupertinoSlider(
  value: _cupertinoSliderValue.toDouble(),
  min: 1.0,
  max: 10.0,
  divisions: 10,
  onChanged: (double newValue) {
    setState(() {
      _cupertinoSliderValue = newValue.round();
    });
  },
  onChangeStart: (double startValue) {
    print('Started change at $startValue');
  },
)

See also:

  • onChangeEnd for a callback that is called when the value change is complete.

Implementation

final ValueChanged<double> onChangeStart