validator<T> method
Implementation
FormFieldValidator<T> validator<T>(Form4FieldState<T> field)
{
return (v) {
String? res;
if (field.widget.validator != null) {
res = field.widget.validator!(field.currentValue);
if (res != null && res.isNotEmpty) {
return res;
}
}
return fieldErrors.containsKey(field.widget.name)
? fieldErrors[field.widget.name]!
: null;
};
}