notEmpty static method

void notEmpty(
  1. String? value, [
  2. String? message
])

Asserts that the string is not empty

Implementation

static void notEmpty(String? value, [String? message]) {
  if (value == null || value.isEmpty) {
    throw AssertionError(message ?? 'String must not be empty');
  }
}