reset method

  1. @override
void reset()

reset field

  1. clear validation
  2. set value to initialValue

Implementation

@override
void reset() {
  _debounce?.cancel();
  _oldTextValue = null;
  _options = [];
  super.reset();
  _stateNotifier.value = null;
  if (hasFocusNode) {
    focusNode.unfocus();
  }
  // we do not want to perform a search
  effectiveController.removeListener(_fieldChange);
  if (value != null) {
    effectiveController.text = widget.displayStringForOption(value!);
  } else {
    effectiveController.text = '';
  }
  effectiveController.addListener(_fieldChange);
}