import 'package:fluttery/fluttery.dart'; /// Interface for secure storage operations. /// /// Provides methods for securely storing and retrieving sensitive data /// like passwords, tokens, API keys, etc. Data stored through this interface /// is encrypted and stored in the device's secure storage (Keychain on iOS, /// Keystore on Android). abstract class SecureStorage implements Service { /// Stores a string value securely with the given [key]. /// /// Returns a Future that completes when the value is successfully stored. /// Throws an exception if the storage operation fails. Future write(String key, String value); /// Retrieves the securely stored string value for the given [key]. /// /// Returns the stored value if found, null otherwise. /// Throws an exception if the retrieval operation fails. Future read(String key); /// Stores an integer value securely with the given [key]. /// /// The integer is converted to a string for storage. Future writeInt(String key, int value); /// Retrieves the securely stored integer value for the given [key]. /// /// Returns the stored integer if found and valid, null otherwise. Future readInt(String key); /// Stores a boolean value securely with the given [key]. /// /// The boolean is converted to a string for storage. Future writeBool(String key, bool value); /// Retrieves the securely stored boolean value for the given [key]. /// /// Returns the stored boolean if found and valid, null otherwise. Future readBool(String key); /// Stores a double value securely with the given [key]. /// /// The double is converted to a string for storage. Future writeDouble(String key, double value); /// Retrieves the securely stored double value for the given [key]. /// /// Returns the stored double if found and valid, null otherwise. Future readDouble(String key); /// Removes the securely stored value for the given [key]. /// /// Returns a Future that completes when the value is successfully removed. Future delete(String key); /// Removes all securely stored values. /// /// Returns a Future that completes when all values are successfully removed. /// Use with caution as this operation cannot be undone. Future deleteAll(); /// Returns all keys incl. values in secure storage Future> readAll(); /// Returns all keys currently stored in secure storage. /// /// Useful for debugging or migration purposes. Future> readAllKeys(); /// Checks if a value exists for the given [key]. /// /// Returns true if a value exists, false otherwise. Future containsKey(String key); }