replaceAt method

void replaceAt(
  1. int index,
  2. E item
)

Replace item at index.

Implementation

void replaceAt(int index, E item) {
  final newList = List<E>.from(val);
  newList[index] = item;
  emit(newList);
}