errorText property
String?
errorText
Gets the error text calculated from validators of the control.
If the control has several errors, then the first error is selected for visualizing in UI.
Implementation
String? get errorText {
if (control.hasErrors && _showErrors) {
final errorKey = control.errors.keys.first;
final validationMessage = _findValidationMessage(errorKey);
return validationMessage != null
? validationMessage(control.getError(errorKey)!)
: errorKey;
}
return null;
}