deselectAllOnThePage method

void deselectAllOnThePage()

Implementation

void deselectAllOnThePage() {
  for (var i = 0; i < _rows.length; i++) {
    var r = _rows[i];
    assert(r.key != null, 'Row key can\'t be null');
    if (r.key != null) {
      if (_selectionState == SelectionState.none ||
          _selectionState == SelectionState.include) {
        _selectionRowKeys.remove(r.key!);
      } else {
        // exclude
        _selectionRowKeys.add(r.key!);
      }
      if (_rows[i].selected) _rows[i] = _clone(r, false);
    }
  }
  if (_selectionState == SelectionState.include &&
      _selectionRowKeys.isEmpty) {
    _selectionState = SelectionState.none;
  }
  notifyListeners();
}