exists method

Future<bool> exists(
  1. String key
)

检查键是否存在

key 要检查的数据键 返回 true 如果键存在,否则返回 false

Implementation

Future<bool> exists(String key) async {
  final db = await _resolveDatabase();
  if (db == null) {
    return false;
  }

  try {
    final value = await _store.record(key).get(db);
    return value != null;
  } catch (error, stacktrace) {
    LogUtil.v('RxNetDataBase: exists error: $error\n$stacktrace');
    return false;
  }
}