moveNext method

bool moveNext()

Moves to the next element.

Returns true if current contains the next element. Returns false if no elements are left.

It is safe to invoke moveNext even when the iterator is already positioned after the last element. In this case moveNext returns false again and has no effect.

A call to moveNext may throw if iteration has been broken by changing the underlying collection.

Source

bool moveNext() {
  int nextPosition = _position + 1;
  if (nextPosition < _length) {
    _current = _array[nextPosition];
    _position = nextPosition;
    return true;
  }
  _current = null;
  _position = _length;
  return false;
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-html/FixedSizeListIterator/moveNext.html