next method

E next ()

Implementation

E next() {
  // Call to hasNext is necessary to make sure we are positioned at the first
  // element when we start iterating.
  if (!hasNext) throw 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.dart.dev/stable/2.13.0/dart-collection/HasNextIterator/next.html