update method
Adds or removes the value
from this notifier.
Subclasses must:
- call notifyUpdateListeners after changing the value.
- additionally override FMultiValueNotifier.value.
Implementation
void update(T value, {required bool add}) {
if (add) {
if (_max case final max? when max <= this.value.length) {
return;
}
super.value = {...this.value, value};
notifyUpdateListeners(value, add: add);
} else {
if (this.value.length <= _min) {
return;
}
super.value = {...this.value}..remove(value);
notifyUpdateListeners(value, add: add);
}
}