deleteAll method

Future<void> deleteAll(
  1. List<String> keys, [
  2. Transaction? txn
])

Implementation

Future<void> deleteAll(List<String> keys, [Transaction? txn]) async {
  if (boxCollection._txnCache != null) {
    boxCollection._txnCache!.add((txn) => deleteAll(keys, txn));
    keys.forEach(_cache.remove);
    _cachedKeys?.removeAll(keys);
    return;
  }

  txn ??= boxCollection._db.transaction(name, 'readwrite');
  final store = txn.objectStore(name);
  for (final key in keys) {
    await store.delete(key);
    _cache.remove(key);
    _cachedKeys?.removeAll(keys);
  }
  return;
}