getSubSource method Null safety

  1. @protected
Iterable<T> getSubSource(
  1. Iterable<T> source,
  2. int skipItems,
  3. int? nrItems

Returns a subset iterable from source that skips skipItems and copies up to nrItems (if specified) or the entire list (if not specified).


Iterable<T> getSubSource(Iterable<T> source, int skipItems, int? nrItems) {
  Iterable<T> subSource = source.skip(skipItems);
  if (nrItems != null) {
    subSource = subSource.take(nrItems);
  return subSource;