flatMap<T, R> static method

List<R> flatMap<T, R>(
  1. Iterable<T> list,
  2. Iterable<R> fn(
    1. T
    )
)

Maps each element of list through fn, flattening the resulting iterables into a single list.

Arr.flatMap(pages, (p) => p.items); // all items from all pages

Implementation

static List<R> flatMap<T, R>(Iterable<T> list, Iterable<R> Function(T) fn) =>
    [for (final v in list) ...fn(v)];