isNotEmpty property Null safety

bool isNotEmpty

Whether this collection has at least one element.

May be computed by checking if iterator.moveNext() returns true.

Example:

final numbers = <int>{1, 2, 3};
print(numbers.isNotEmpty); // true;
print(numbers.iterator.moveNext()); // true

Implementation

bool get isNotEmpty => !isEmpty;