delete method
Deletes a value from secure storage.
Returns true if the key
was deleted, false if it didn't exist.
This operation is idempotent - calling it multiple times on the same key
will not cause an error.
Example:
final wasDeleted = await storage.delete('session.token');
if (wasDeleted) {
print('Token was deleted');
} else {
print('Token did not exist');
}
See also:
Implementation
@override
Future<bool> delete(String key) async {
final exists = await has(key);
if (!exists) return false;
await _storage.delete(key: key);
return true;
}