updateAt method

void updateAt(
  1. int index,
  2. T item
)

Implementation

void updateAt(int index, T item) {
  if (index >= 0 && index < list.length) {
    final currentList = List<T>.from(list);
    currentList[index] = item;
    value = currentList;
  }
}