withErrorMessage method

FormFieldValidator<T> withErrorMessage(
  1. String errorMessage
)

Overrides the error message of the current validator.

Implementation

FormFieldValidator<T> withErrorMessage(String errorMessage) {
  return (T? valueCandidate) {
    final String? result = this(valueCandidate);
    return result != null ? errorMessage : null;
  };
}