FlutterSecureStorageAdapter class final

A KeyValueStoreInterface implementation backed by FlutterSecureStorage.

Provides secure, encrypted key-value storage suitable for storing sensitive data such as tokens, credentials, or secrets.

  • On Android, uses AndroidOptions with encryptedSharedPreferences enabled for maximum security.
  • On iOS, relies on the Keychain for secure storage.

Example:

final storage = FlutterSecureStorageAdapter();
await storage.write('token', 'abc123');
final token = await storage.read('token');
Annotations

Constructors

FlutterSecureStorageAdapter.new({FlutterSecureStorage storage = const FlutterSecureStorage(aOptions: AndroidOptions(resetOnError: true, encryptedSharedPreferences: true))})
Creates a FlutterSecureStorageAdapter with the given storage.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(String key) Future<void>
Deletes the entry for the given key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String key) Future<String?>
Reads the value associated with the given key.
readAll() Future<Map<String, String>>
Reads and returns all key-value pairs from secure storage.
toString() String
A string representation of this object.
inherited
write(String key, String value) Future<void>
Writes the provided value for the given key.

Operators

operator ==(Object other) bool
The equality operator.
inherited