isNotEmpty property
- @override
- @Deprecated("IsNotEmpty is not supported as it would require consuming part of the iterator, which is likely not the users intent. Use peekable() instead.")
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
@Deprecated(
"IsNotEmpty is not supported as it would require consuming part of the iterator, which is likely not the users intent. Use peekable() instead.")
bool get isNotEmpty {
assert(false,
"IsNotEmpty is not supported as it would require consuming part of the iterator, which is likely not the users intent. Use peekable() instead.");
return super.isNotEmpty;
}