flat<T> method

List<T> flat<T>()

Implementation

List<T> flat<T>() {
  final result = <T>[];
  for (var e in this) {
    if (e is Iterable<T>) {
      result.addAll(e);
    } else {
      result.add(e as T);
    }
  }

  return result;
}