setValue method

  1. @override
void setValue(
  1. int newValue
)
override

Sets a new value.

if newValue is not a valid value for this configuration, the nearest valid value will be chosen.

Implementation

@override
void setValue(int newValue) {
  final isValid = _isValidValue(newValue);
  if (isValid) {
    _currentIndex = getIndexOf(newValue);
  } else {
    _currentIndex = getIndexOf(_getNearestValidValue(newValue));
  }
  notifyListeners();
}