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);
}
}
_rowsByPrimaryKey.removeWhere((key, _) => test(key));
_rows.removeWhere((row) {
final pk = decoder.getPrimaryKey(row);
return test(pk);
});
_refreshRowsNotifier();
if (touchedKeys.isNotEmpty) {
_notifyRowListeners(touchedKeys);
}
}