ChunkRange<T> constructor

ChunkRange<T>(
  1. Iterable<T> _iterable,
  2. int _chunkSize
)

Creates a ChunkRange that splits the given iterable into chunks of a specific size.

Throws an ArgumentError if the chunk size is less than or equal to 0.

Implementation

ChunkRange(this._iterable, this._chunkSize) {
  if (_chunkSize <= 0) {
    throw ArgumentError('Chunk size must be strictly positive.');
  }
}