nullGenerator<E> static method

List<E> nullGenerator<E>(
  1. E builder(
    1. int
    ), {
  2. int? itemCount,
})

Implementation

static List<E> nullGenerator<E>(E Function(int) builder, {int? itemCount}) {
  final newList = <E>[];
  E element;
  for (var i = 0; itemCount != null ? i < itemCount : true; i++) {
    element = builder(i);
    if (element == null) break;
    newList.add(element);
  }
  return newList;
}