ValueChanged<double> onChanged
read-only

Called when the user selects a new value for the slider.

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

If null, the slider will be displayed as disabled.

The callback provided to onChanged should update the state of the parent StatefulWidget using the State.setState method, so that the parent gets rebuilt; for example:

new Slider(
  value: _duelCommandment.toDouble(),
  min: 1.0,
  max: 10.0,
  divisions: 10,
  label: '$_duelCommandment',
  onChanged: (double newValue) {
    setState(() {
      _duelCommandment = newValue.round();
    });
  },
),