updateAt method

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

updateAt method.

Implementation

void updateAt(int index, T item) {
  throwIfDisposed('updateAt');

  /// Stores the =.
  final current = value;

  /// if method.
  if (index >= 0 && index < current.length) {
    /// Stores the =.
    final newList = List<T>.from(current);
    newList[index] = item;
    value = newList;
  }
}