select method

  1. @override
void select(
  1. T value,
  2. bool selected
)
override

Handles a change in the selection.

Implementation

@override
void select(T value, bool selected) {
  if (selected) {
    if (_max != null && _values.length >= _max) {
      return;
    }

    _values.add(value);
  } else {
    if (_values.length <= _min) {
      return;
    }

    _values.remove(value);
  }

  notifyListeners();
}