setValue method

void setValue(
  1. String name,
  2. Object? value
)

Sets value for name, marks the form as edited, and revalidates the field once the user has touched it or attempted a submit.

Implementation

void setValue(String name, Object? value) {
  _values[name] = value;
  if (_status is! PrismFormSubmitting) {
    _status = const PrismFormEditing();
  }
  if (_touched.contains(name) || _submitAttempted) {
    _validateField(name);
  }
  notifyListeners();
}