emptyValidator function

String? emptyValidator(
  1. String? value,
  2. String? label
)

Implementation

String? emptyValidator(String? value, String? label) {
  if (value == null || value.trim() == '') {
    return '${label ?? 'Field'} is Required';
  }
  return null;
}