getError method

String? getError(
  1. String field
)
inherited

Get the validation error message for a field.

Returns null if the field has no error.

final errorMessage = controller.getError('email');
if (errorMessage != null) {
  print(errorMessage); // "The email must be a valid email address."
}

Implementation

String? getError(String field) => validationErrors[field];