BoolList constructor Null safety
Creates a list of booleans with the provided length.
The list is initially filled with the fill
value, and
the list is growable if growable
is true.
Implementation
factory BoolList(int length, {bool fill = false, bool growable = false}) {
RangeError.checkNotNegative(length, 'length');
BoolList boolist;
if (growable) {
boolist = _GrowableBoolList(length);
} else {
boolist = _NonGrowableBoolList(length);
}
if (fill) {
boolist.fillRange(0, length, true);
}
return boolist;
}