toggle method
Toggles selection for index. Returns the new selected state.
Implementation
bool toggle(int index) {
final bool nowSelected;
if (_selected.contains(index)) {
_selected.remove(index);
nowSelected = false;
} else {
_selected.add(index);
nowSelected = true;
}
notifyListeners();
return nowSelected;
}