BitList.filled constructor

BitList.filled(
  1. int length,
  2. bool fill, {
  3. bool growable = false,
})

Constructs a bit list of the given length, and initializes the value at each position with fill.

Implementation

factory BitList.filled(int length, bool fill, {bool growable = false}) {
  final buffer = Uint32List((length + bitOffset) >> bitShift);
  if (fill) buffer.fillRange(0, buffer.length, bitMask);
  return growable
      ? GrowableBitList(buffer, length)
      : FixedBitList(buffer, length);
}