insert method

void insert(
  1. int index,
  2. T value
)

Inserts an item at the specified index. If the index is out of range, adds to the end.

Implementation

void insert(int index, T value) {
  if (index >= 0 && index < length) {
    _children.insert(index, value);
  } else {
    _children.add(value);
  }
}