removeRows method
Implementation
@override
void removeRows(
List<PlutoRow> rows, {
bool notify = true,
}) {
if (rows.isEmpty) {
return;
}
final Set<Key> removeKeys = Set.from(rows.map((e) => e.key));
if (currentRowIdx != null &&
refRows.length > currentRowIdx! &&
removeKeys.contains(refRows[currentRowIdx!].key)) {
resetCurrentState(notify: false);
}
Key? selectingCellKey;
if (hasCurrentSelectingPosition) {
selectingCellKey = refRows
.originalList[currentSelectingPosition!.rowIdx!].cells.entries
.elementAt(currentSelectingPosition!.columnIdx!)
.value
.key;
}
if (enabledRowGroups) {
removeRowAndGroupByKey(removeKeys);
} else {
refRows.removeWhereFromOriginal((row) => removeKeys.contains(row.key));
}
updateCurrentCellPosition(notify: false);
setCurrentSelectingPositionByCellKey(selectingCellKey, notify: false);
currentSelectingRows.removeWhere((row) => removeKeys.contains(row.key));
notifyListeners(notify, removeRows.hashCode);
}