waitTasks method

Future<List<T>> waitTasks({
  1. bool onlySubmitted = false,
})

Waits the tasks executions and returns a List of waited tasks.

  • onlySubmitted if true will wait only for submitted tasks.

Implementation

Future<List<T>> waitTasks({bool onlySubmitted = false}) async {
  var tasks = (onlySubmitted ? where((t) => t.wasSubmitted) : this).toList();
  await Future.wait(tasks.map((t) => t.waitResult()));
  return tasks;
}