removeRowsWhere method
void
removeRowsWhere(
- bool test(
- dynamic pk
)
)
Implementation
void removeRowsWhere(bool Function(dynamic pk) test) {
final touchedKeys = <dynamic>[];
if (_rowNotifiers.isNotEmpty) {
for (final key in _rowNotifiers.keys) {
if (test(key)) touchedKeys.add(key);
}
}
final matchedKeys = _rowsByPrimaryKey.keys.where(test).toList();
for (final key in matchedKeys) {
_rowsByPrimaryKey.remove(key);
_rowOwners.remove(key);
}
_rows.removeWhere((entry) {
final pk = decoder.getPrimaryKey(entry.row);
return test(pk);
});
_refreshRowsNotifier();
if (touchedKeys.isNotEmpty) {
_notifyRowListeners(touchedKeys);
}
}