notBeEmpty method

void notBeEmpty([
  1. String? errorMessage
])

Instructs StringMust to make sure the given string is not empty.

Implementation

void notBeEmpty([String? errorMessage]) {
  _validators.add(
    (value) => value == null || value.isEmpty
        ? errorMessage ?? 'String is empty or is null'
        : '',
  );
}