Flutter Design Patterns: 9 — Iterator

An overview of the Iterator design pattern and its implementation in Dart and Flutter

Mangirdas Kazlauskas
Flutter Community

--

In the last article, I analyzed one of the behavioural design patterns — Interpreter. This time I would like to represent the pattern which specific implementation(s) you have probably already used in your day-to-day programming without even noticing or considering it — the Iterator design pattern.

Update 2022–09–15: I moved this blog to my personal website. For a better reading experience, up to date articles, interactive code examples and some extra content FOR FREE, check kazlauskas.dev.

Table of Contents

  • What is the Iterator design pattern?
  • Analysis
  • Implementation
  • Other articles in this series
  • Your contribution

What is the Iterator design pattern?

Iterating over the graph (source)

Iterator is a behavioural design pattern, also known as Cursor. The intention of this design pattern is described in the GoF book:

--

--

Mangirdas Kazlauskas
Flutter Community

Google Developer Expert for Flutter & Dart | Read the blog for free on kazlauskas.dev | Let's stay in touch - https://twitter.com/mkobuolys