setValue method

bool setValue(
  1. T? newValue, [
  2. bool state = true
])

Implementation

bool setValue(T? newValue, [bool state = true]) {
  if (readOnly == true || disabled == true) {
    return false;
  }

  handlerOnChange(newValue);
  if (manual) {
    return true;
  }
  handlerAutoCollect(newValue, value);
  if (isChanged(newValue, value)) {
    if (openHapticFeedback()) {
      handleHapticFeedback(widget.hapticFeedback);
    }

    value = newValue;
    if (state) {
      var call = getSetStateCallback();
      setState(call);
    }
  }
  return true;
}