validateNotEmpty function

String? validateNotEmpty(
  1. String? value,
  2. String type
)

Implementation

String? validateNotEmpty(String? value, String type) {
  if (value != null && value.isEmpty) {
    return '${type.inCaps} must not be empty';
  } else {
    return null;
  }
}