removeAllItems method

  1. @override
Future<void> removeAllItems(
  1. Iterable<E> items
)
override

Removes multiple objects from the container.

This method extracts the ID from each item using getId, then removes all corresponding objects from the backend in a single batch operation. After removal, key-specific listeners for each key are notified, followed by all global listeners.

Parameters:

  • items - The objects to remove. IDs are extracted using getId.

Throws:

See also:

Implementation

@override
Future<void> removeAllItems(Iterable<E> items) async {
  final keys = items.map(getId).toList();
  await backend.removeAll(keys.map(encodeKey));
  for (final key in keys) {
    notifyKeyListeners(key);
  }
  notifyListeners();
}