replaceAt method

void replaceAt(
  1. int index,
  2. T value
)

Replace item at 'index' with 'value'

Implementation

void replaceAt(int index, T value) {
    List<T> buffer = _list.toList();
    buffer.removeAt(index);
    buffer.insert(index, value);
    _list = List<T>.from(buffer);
}