FillWith method

P FillWith(
  1. int count,
  2. V init(
    1. P,
    2. int
    ), {
  3. String? key,
})

Fills a tracked slot of count structs by setting each element to the C returned by init(ptr, i).

Implementation

P FillWith(int count, V Function(P, int) init, {String? key}) {
  final p = At(slotKey(key), count);
  for (int i = 0; i < count; i++) indexSetterFunc(p, i, init(p, i));
  return p;
}