next method

E next()

Source

E next() {
  // Call to hasNext is necessary to make sure we are positioned at the first
  // element when we start iterating.
  if (!hasNext) throw new StateError("No more elements");
  assert(_state == _HAS_NEXT_AND_NEXT_IN_CURRENT);
  E result = _iterator.current;
  _move();
  return result;
}

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