executeAll<P, R> method

List<Future<R>> executeAll<P, R>(
  1. Iterable<AsyncTask<P, R>> tasks, {
  2. AsyncExecutorSharedDataInfo? sharedDataInfo,
})

Executes all the tasks using this executor. Calling execute for each task.

Implementation

List<Future<R>> executeAll<P, R>(Iterable<AsyncTask<P, R>> tasks,
    {AsyncExecutorSharedDataInfo? sharedDataInfo}) {
  if (tasks is List<AsyncTask<P, R>>) {
    return List.generate(tasks.length,
        (i) => execute(tasks[i], sharedDataInfo: sharedDataInfo));
  } else {
    return tasks
        .toList()
        .map((t) => execute(t, sharedDataInfo: sharedDataInfo))
        .toList();
  }
}