removeAt method

  1. @useCopy
IList<T> removeAt(
  1. int index, [
  2. Output<T>? removedItem
])

Removes the object at position index from this list.

This method reduces the length of this by one and moves all later objects down by one position.

Returns the list without the removed object.

The index must be in the range 0 ≤ index < length.

If you want to recover the removed item, you can pass a mutable removedItem.

Implementation

@useCopy
IList<T> removeAt(int index, [Output<T>? removedItem]) {
  // TODO: Still need to implement efficiently.
  var list = toList(growable: true);
  var value = list.removeAt(index);
  removedItem?.save(value);
  return IList._unsafeFromList(list, config: config);
}