replace method

void replace(
  1. int index,
  2. T element
)

Implementation

void replace(int index, T element) {
  replaceRange(index, index + 1, [element]);
}