contains method

  1. @override
Future<bool> contains(
  1. String key
)
override

Checks if the cache contains an entry for the given key.

Implementation

@override
Future<bool> contains(String key) async {
  await _ensureDbOpen();

  final transaction = _db!.transaction('data', 'readonly');
  final store = transaction.objectStore('data');
  final result = await store.getObject(key);
  await transaction.completed;

  return result != null;
}