requireNoNulls method

void requireNoNulls()

Returns an original collection containing all the non-null elements, throwing an StateError if there are any null elements.

Implementation

void requireNoNulls() {
  if (any((element) => element == null)) {
    throw StateError('At least one element is null.');
  }
}