concatLists<T> function

List<T> concatLists<T>(
  1. Iterable<Iterable<T>> lists
)

Combine lists into one.

Implementation

List<T> concatLists<T>(Iterable<Iterable<T>> lists) {
  if (lists.isEmpty) {
    return [];
  }
  if (lists.length == 1) {
    return lists.first.toList();
  }
  List<T> result = [];
  for (Iterable<T> l in lists) {
    result += l.toList();
  }
  return result;
}