BitList.generate constructor

BitList.generate(
  1. int length,
  2. bool generator(
    1. int index
    ), {
  3. bool growable = false,
})

Constructs a bit list of the given length by calling a generator function for each index.

Implementation

factory BitList.generate(int length, bool Function(int index) generator,
        {bool growable = false}) =>
    BitList.of(IntegerRange(length).map(generator), growable: growable);