Open1

【Flutter】高度な非同期処理 (Future, Stream, Completer, isolates)

heyhey1028heyhey1028

Future

Future.value()

複数のFutureを待つ

Future.waitにfutureの配列を渡す

import 'dart:async';

Future main() async {
  var data = [];
  var futures = <Future>[];
  for (var d in data) {
    futures.add(d.loadData());
  }
  await Future.wait(futures);
}