checkIterableNotEmpty<T extends Iterable> static method

T checkIterableNotEmpty<T extends Iterable>(
  1. T iterable, [
  2. String? name
])

Check that iterable is not empty.

Implementation

static T checkIterableNotEmpty<T extends Iterable<dynamic>>(
  T iterable, [
  String? name,
]) {
  if (iterable.isNotEmpty) return iterable;
  throw ArgumentError.value(iterable, name, "Must not be empty");
}