update method Null safety
- MaterialState state,
- bool add
Adds state
to value if add
is true, and removes it otherwise,
and notifies listeners if value has changed.
Implementation
void update(MaterialState state, bool add) {
final bool valueChanged = add ? value.add(state) : value.remove(state);
if (valueChanged) {
notifyListeners();
}
}