insertAt method

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

Inserts item at index, clamped to valid range.

Implementation

void insertAt(int index, T item) {
  insert(index.clamp(0, length), item);
}