errorText property
String?
get
errorText
get errorText
null when field has no error or quietlyValidate
Implementation
String? get errorText => !enabled ||
(_formeState?.quietlyValidate ?? false) ||
widget.quietlyValidate
? null
: _status.validation.error;
set
errorText
(String? errorText)
if errorText
is null , reset validation
if errorText
not null , set custom error text even though field has no validators at all
field will rebuild after this method called , a validation may be performed during building. in this case , custom validation will be overwritten by new validation.
will not worked on disabled fields
Implementation
set errorText(String? errorText) {
if (!enabled) {
return;
}
final FormeFieldValidation validation;
if (errorText == null) {
validation = _initialValidation;
} else {
validation = _CustomValidation.invalid(errorText);
}
if (_status.validation != validation) {
setState(() {
_validateGen++;
_status = _status._copyWith(validation: FormeOptional(validation));
});
}
}