didChange method

  1. @override
void didChange(
  1. dynamic changedValue
)
override

Updates this field's state to the new value. Useful for responding to child widget changes, e.g. Slider's Slider.onChanged argument.

Triggers the Form.onChanged callback and, if Form.autovalidateMode is AutovalidateMode.always or AutovalidateMode.onUserInteraction, revalidates all the fields of the form.

Implementation

@override
void didChange(changedValue) {
  if (value != changedValue) {
    _value = changedValue;
    widget.validator(changedValue);
    if (widget.onChanged != null) {
      widget.onChanged!(changedValue);
    }
  }
  super.didChange(changedValue);
}