chunked method
Implementation
Iterable<List<T>> chunked(int chunkSize) sync* {
List<T> chunk = [];
for (T e in this) {
chunk.add(e);
if (chunk.length >= chunkSize) {
yield chunk;
chunk = [];
}
}
if (chunk.isNotEmpty) {
yield chunk;
}
}