setAll method
Stores multiple objects with their associated keys.
This method serializes all objects in the items map and stores them
in the backend in a single batch operation. All keys are validated and
encoded before storage. After storing, key-specific listeners for each
key are notified, followed by all global listeners.
Parameters:
items- A map of keys to objects. Each key must be valid (seevalidateKeyfor rules).
Throws:
- ArgumentError if any key is invalid
See also:
Implementation
@override
Future<void> setAll(Map<String, E> items) async {
validateKeys(items.keys);
await backend.setAll(items.map((key, value) => MapEntry(encodeKey(key), serialize(value))));
for (final key in items.keys) {
notifyKeyListeners(key);
}
notifyListeners();
}