isEmpty property
- @override
- @Deprecated("IsEmpty 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 no elements.
May be computed by checking if iterator.moveNext()
returns false
.
Example:
final emptyList = <int>[];
print(emptyList.isEmpty); // true;
print(emptyList.iterator.moveNext()); // false
Implementation
@override
@Deprecated(
"IsEmpty is not supported as it would require consuming part of the iterator, which is likely not the users intent. Use peekable() instead.")
bool get isEmpty {
assert(false,
"IsEmpty is not supported as it would require consuming part of the iterator, which is likely not the users intent. Use peekable() instead.");
return super.isEmpty;
}