checkNotEmpty static method

String checkNotEmpty(
  1. String? value,
  2. String message
)

Returns value, or throws an ArgumentError with message if it is null or empty.

Implementation

static String checkNotEmpty(String? value, String message) {
  if (value == null || value.isEmpty) {
    throw ArgumentError(message);
  } else {
    return value;
  }
}