setItem method
Implementation
void setItem(T item, [int? index]) {
super.onNotifyWithCallback(() {
var list = List<T>.from(items);
if (index != null && itemCount >= index) {
list.insert(index, item);
} else {
list.add(item);
}
items = list;
});
}