updateError method

FormFieldState<T> updateError(
  1. String? error
)

Updates the error field for the FormFieldState.

This method is used to explicitly set or clear the error message associated with the form field. It accepts a nullable string, allowing you to either set an error message or clear any existing message.

error The new error message string. Pass null to clear any existing error.

Returns a new FormFieldState object with an updated error field.

Implementation

FormFieldState<T> updateError(String? error) => copyWith(error: error);