isEmpty property

  1. @override
  2. @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
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;
}