partition<T> function

Iterable<List<T>> partition<T>(
  1. Iterable<T> iterable,
  2. 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 ? [] : _Partition<T>(iterable, size);
}