requiredValidator static method
Implementation
static String? Function(String?)? requiredValidator(String? requiredError) => (value) {
if (value != null && value.trim() != '') {
return null;
}
return requiredError ?? 'Required field.';
};