fill method

void fill(
  1. T value
)

Fills the list with the provided value.

Each element in the list gets replaced with the value.

Implementation

void fill(T value) {
  for (var i = 0; i < size; i++) {
    set(i, value);
  }
}