fill function

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

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

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

Implementation

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