exists method

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

Checks if key exists in store

Implementation

@override
Future<bool> exists(String key) async {
  // put async/await requests in inner future (because delete also has inner futures)
  // it ensures to call futures in right order
  return await Future.delayed(Duration.zero, () async {
    final database = await _openDatabase();
    final resp = await _store.record(key).getSnapshot(database);
    return resp?.value != null;
  });
}