isNotEmpty property Null safety

  1. @override
bool isNotEmpty
override

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

@override
bool get isNotEmpty => _list.isNotEmpty;