addOrReplace method
void
addOrReplace(
- dynamic model
? Add value to list if doesn't exist else replace Current Value
Implementation
void addOrReplace(model) {
if (contains(model)) {
insert(indexOf(model), model);
removeAt(indexOf(model));
} else {
add(model);
}
}