insert method

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

Insert an element at the given index in the List held in this cell.

NOTE: This method does not modify the underlying list but creates a new list with the element inserted at the given index.

Implementation

void insert(int index, T elem) {
  final elements = List<T>.from(value);
  elements.insert(index, elem);
  value = elements;
}