replaceAt method
New list with element at index replaced by value; no-op if index out of range.
Implementation
@useResult
List<T> replaceAt(int index, T value) {
final List<T> out = List<T>.of(this);
if (index >= 0 && index < length) out[index] = value;
return out;
}