fill function

List fill(
  1. List list,
  2. dynamic value, [
  3. int start = 0,
  4. int? end,
])

Fills elements of list with value from start up to, but not including, end. Example

_.fill(List(3), 4);
// Returns [4, 4, 4]

Implementation

List fill(List list, dynamic value, [int start = 0, int? end]) {
  int length = list.length;
  if (length <= 0) {
    return [];
  }
  end = end == null ? length : end;
  return baseFill(list, value, start, end);
}