has method
Checks if a key exists in secure storage.
Returns true if the key
exists in storage, false otherwise.
This is useful for checking if a value exists before attempting to read it.
Example:
if (await storage.has('auth.token')) {
final token = await storage.read('auth.token');
// Use token...
} else {
// Handle missing token...
}
See also:
Implementation
@override
Future<bool> has(String key) async {
final containsKey = await _storage.containsKey(key: key);
return containsKey;
}