O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Iterable interface

The Iterable interface has a strong relation to the Iterator. The Iterator is an interface used to get items from a collection, one at a time. It follows the fail-fast principles to immediately report whether the iterating collection was modified. The Iterator has a property called current, which is used to return a currently pointed element. The Iterator is initially positioned before the first element in a collection. The moveNext method returns true if there is a next element in the collection and false if not. Before using the Iterator, it must be initialized with the moveNext method to point it to the first element. In the following code, we don't initialize the Iterator with the moveNext method:

void main() { List<String> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required