awaitingStreamMoveNext property

bool awaitingStreamMoveNext
getter/setter pair

Whether the pending suspension is an await for's moveNext().

SCE16. This used to be awaitingStreamConversion, and the name was accurate: the loop suspended ONCE on stream.toList() and then walked the list. That made await for eager — every element was produced before the body ran once, a break could not stop the producer, and a loop over an infinite stream never ran its body at all because toList() never completes. The loop now suspends once per element on StreamIterator.moveNext, which is what await for means.

Implementation

bool awaitingStreamMoveNext = false;