onChanged property

ValueChanged? onChanged

Called when the user is selecting a new value for the slider by dragging.

The slider passes the new value to the callback but does not change its state until the parent widget rebuilds the slider with new value.

If it is null, the slider will be disabled.

This snippet shows how to create a numeric SfSlider.

double _value = 4.0;

  min: 0.0,
  max: 10.0,
  value: _value,
  onChanged: (dynamic newValue) {
    setState(() {
      _value = newValue;


final ValueChanged<dynamic>? onChanged;