getError method

FutureOr<ValidationResult?>? getError(
  1. FormKey key
)

Retrieves the validation result for a specific form field.

This method returns the current validation state for the specified form key, which can be either a synchronous ValidationResult or a Future for asynchronous validation. Returns null if no validation result exists for the key.

Parameters:

  • key (FormKey): The form key to get validation result for

Returns the validation result or null if none exists.

Implementation

FutureOr<ValidationResult?>? getError(FormKey key) {
  return _validity[key]?.result;
}