How do I read the contents of multiple files asynchronously?

This doesn't work:

List<String> texts;
new Directory(path).list().listen((File f) {
  f.readAsString().then((content) => texts.add(text)
}, onDone: () => ...)

The Future returned by readAsString will fire after onDone is triggered. Future.wait looks like what I want, but I've a stream, not a list of futures. I tried to make use of a StreamTransformer but failed.

This is a workaround, but then I could have used listSync() in the first place, I figure...

new Directory(path).list().toList().then((List<File> list) {
    return Future.wait(list.map((File f) => f.readAsString()));
  }).then((List<String> texts) {
    ...
  })

What's the best way to transform a stream by mapping its values using some asynchronous operation that returns a future?
Shared publiclyView activity