invert method

void invert(
  1. int count
)

Inverts the selection (selects unselected, deselects selected).

Only works in multi-select mode.

Implementation

void invert(int count) {
  if (!multiSelect) return;
  final newSelection = <int>{};
  for (var i = 0; i < count; i++) {
    if (!_selected.contains(i)) {
      newSelection.add(i);
    }
  }
  _selected
    ..clear()
    ..addAll(newSelection);
}