setSelectingMode method

  1. @override
void setSelectingMode(
  1. PlutoGridSelectingMode selectingMode, {
  2. bool notify = true,
})
inherited

Set the mode to select cells or rows.

If PlutoGrid.mode is PlutoGridMode.select or PlutoGridMode.selectWithOneTap Coerced to PlutoGridSelectingMode.none regardless of selectingMode value.

When PlutoGrid.mode is PlutoGridMode.multiSelect Coerced to PlutoGridSelectingMode.row regardless of selectingMode value.

Implementation

@override
void setSelectingMode(
  PlutoGridSelectingMode selectingMode, {
  bool notify = true,
}) {
  if (mode.isSingleSelectMode) {
    selectingMode = PlutoGridSelectingMode.none;
  } else if (mode.isMultiSelectMode) {
    selectingMode = PlutoGridSelectingMode.row;
  }

  if (_state._selectingMode == selectingMode) {
    return;
  }

  _state._currentSelectingRows = [];

  _state._currentSelectingPosition = null;

  _state._selectingMode = selectingMode;

  notifyListeners(notify, setSelectingMode.hashCode);
}