length property

  1. @override
  2. @Deprecated("Length is not supported as it would require consuming the iterator, which is likely not the users intent. Use count() instead.")
int get length
override

The number of elements in this Iterable.

Counting all elements may involve iterating through all elements and can therefore be slow. Some iterables have a more efficient way to find the number of elements. These must override the default implementation of length.

Implementation

@override
@Deprecated(
    "Length is not supported as it would require consuming the iterator, which is likely not the users intent. Use count() instead.")
int get length {
  assert(false,
      "Length is not supported as it would require consuming the iterator, which is likely not the users intent. Use count() instead.");
  return super.length;
}