exists method

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

Returns true if the keystore currently contains key, else false. The backend-agnostic existence check — the same call site works against every backend.

Should be O(1) on every backend that ships with this package (Hive uses Box.containsKey; SQL backends use an indexed SELECT 1 ... LIMIT 1).

Implementation

@override
Future<bool> exists(String key) async {
  return _getBox().keys.contains(key);
}