emptyFieldValidator static method
emptyFieldValidator to validate if a form field is empty or not
validator: (value) => SimpleValidations.emptyFieldValidator(value, [errorMessage]),
Implementation
static String? emptyFieldValidator(String? value, [String? errorMessage]) {
if (value == null || value.isEmpty) {
return errorMessage ?? 'Required';
}
return null;
}