setValue method

void setValue(
  1. String key,
  2. dynamic value
)

Updates the value of a specific field and notifies listeners.

Implementation

void setValue(String key, dynamic value) {
  if (_values[key] != value) {
    _values[key] = value;
    _errors.remove(key);
    notifyListeners();
    _listeners[key]?.forEach((cb) => cb());
    _valueStreamController.add(formData);
  }
}