partition<T> function

Iterable<List<T>> partition <T>(Iterable<T> iterable, int size)

Partitions the input iterable into lists of the specified size.

Implementation

Iterable<List<T>> partition<T>(Iterable<T> iterable, int size) {
  return iterable.isEmpty ? [] : new _Partition<T>(iterable, size);
}