notEmpty static method

String? notEmpty(
  1. String? checkValue, {
  2. String? errorMessage,
})

Checks that checkValue is not equal to "".

If checkValue is equal to "" the function will return errorMessage if provided, or the default error if not. Otherwise null is returned

Implementation

static String? notEmpty(String? checkValue, {String? errorMessage}) {
  if (checkValue == "") {
    return errorMessage ?? "Field can't be empty";
  }
  return null;
}