exists method

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

Check if key exists in local storage

Implementation

@override
/// Check if key exists in local storage
Future<bool> exists(String key) async {
  final db = await _initializedDB;
  final txn = db.transaction(storeName, idbModeReadOnly);
  final value = await txn.objectStore(storeName).getObject(key);
  await txn.completed;
  return value != null;
}