Doing things lazily is usually the best option, so I would make this return an iterable instead of a list with code that looks like:

```dart
Iterable<Page> loadData(Foo response) {
  var docs = loadYaml(response);
  return docs.keys.map((String k) => generateContent(k, docs[k], true));
}
```