setItemsAt method

void setItemsAt(
  1. List<T> items,
  2. int index
)

Implementation

void setItemsAt(List<T> items, int index) {
  super.onNotifyWithCallback(() {
    var list = List<T>.from(this.items);
    if (itemCount >= index) {
      list.insertAll(index, items);
    } else {
      list.addAll(items);
    }
    this.items = list;
  });
}