You need to use Future.forEach:
https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Future#id_forEach
And you'll also need to await the forEach:
Future<bool> clear() async {
var succeeded = true;
await Future.forEach(_caches, (Cache cache) async {
succeeded = succeeded && await cache.clear();
});
return succeeded;
}
By the way, your operation is an async fold on _caches. You can use Quiver's async.reduceAsync to make this shorter:
import 'package:quiver/async.dart' show reduceAsync;
Future<bool> clear() => reduceAsync(_caches, true, (s, cache) async => s && await cache.clear());