setErrorForObject method Null safety

void setErrorForObject(
  1. Object object,
  2. dynamic value
)

Sets the error state for the object equal to the value passed in and notifies Listeners If you're using a primitive type the value SHOULD NOT BE CHANGED, since Hashcode uses == value

Implementation

void setErrorForObject(Object object, dynamic value) {
  _errorStates[object.hashCode] = value;
  notifyListeners();
}