makeFakes<T> function

List<T> makeFakes<T>({
  1. required ThingGenerator<T> factory,
  2. int count = 20,
})

Generates a non-growable count sized list of the items returned by factory.

Implementation

List<T> makeFakes<T>({required ThingGenerator<T> factory, int count = 20}) {
  return List<T>.generate(
    count,
    (index) => factory(index, randomInt, randomBool),
    growable: false,
  );
}