containsKey static method
Implementation
static Future<bool> containsKey({
required String key,
Type type = Type.CRED_TYPE_GENERIC,
bool encrypted = false,
bool fAsSelf = false,
}) async {
assert(key.isNotEmpty);
assert(!fAsSelf || (fAsSelf && encrypted));
try {
return await _channel.invokeMapMethod<String, dynamic>('get', {
'key': key,
'type': type.index + 1,
'encrypted': encrypted,
'fAsSelf': fAsSelf,
}).then((data) {
if (data == null) return false;
return true;
});
} catch (err) {
if (err is PlatformException && err.code != 'ERROR_NOT_FOUND')
throw err;
else
return false;
}
}