toggleSelectingRow method
Select or unselect a row.
Implementation
@override
void toggleSelectingRow(int? rowIdx, {notify = true}) {
if (!selectingMode.isRow) {
return;
}
if (rowIdx == null || rowIdx < 0 || rowIdx > refRows.length - 1) {
return;
}
final PlutoRow row = refRows[rowIdx];
final keys = Set.from(currentSelectingRows.map((e) => e.key));
if (keys.contains(row.key)) {
currentSelectingRows.removeWhere((element) => element.key == row.key);
} else {
currentSelectingRows.add(row);
}
notifyListeners(notify, toggleSelectingRow.hashCode);
}