selectAllOnThePage method

void selectAllOnThePage()

Implementation

void selectAllOnThePage() {
  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.add(r.key!);
      } else {
        //exclude
        _selectionRowKeys.remove(r.key!);
      }
      if (!_rows[i].selected) _rows[i] = _clone(r, true);
    }
  }
  if (_selectionState == SelectionState.none &&
      _selectionRowKeys.isNotEmpty) {
    _selectionState = SelectionState.include;
  }
  notifyListeners();
}