addOrUpdate method
void
addOrUpdate(
- T item
add an item to a list, or update item if it already exists
Implementation
void addOrUpdate(T item) {
final index = indexOf(item);
if (index != -1) {
this[index] = item;
} else {
add(item);
}
}