validateEmpty static method

String? validateEmpty({
  1. String? value,
  2. String? errorMessage,
})

Implementation

static String? validateEmpty({String? value, String? errorMessage}) {
  if (value == null || value.isEmpty) {
    return errorMessage ?? "This field may not be empty";
  }
  return null;
}