errorMessage property
String?
get
errorMessage
Implementation
String? get errorMessage {
if (isValid || isPure) return null;
if (displayError == UsernameError.empty) return 'El campo es obligatorio';
if (displayError == UsernameError.tooShort) {
return 'El campo debe tener al menos $minLength caracteres';
}
if (displayError == UsernameError.tooLong) {
return 'El campo debe tener máximo $maxLength caracteres';
}
return null;
}