notEmpty static method
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;
}