removeAt method

  1. @useResult
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

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