FlutterSecureStoragePlugin class
A secure storage plugin implementation using flutter_secure_storage.
This plugin provides encrypted key-value storage for sensitive information using platform-specific secure storage mechanisms:
- iOS: Keychain Services
- Android: EncryptedSharedPreferences
- macOS: Keychain Services
- Linux: Secret Service API
- Windows: Data Protection API (DPAPI)
- Web: LocalStorage with encryption
Example usage:
final storage = vyuh.platform.getPlugin<StoragePlugin>();
// Store a value
await storage.write('auth.token', 'my-secure-token');
// Read a value
final token = await storage.read('auth.token');
// Check if exists
if (await storage.has('auth.token')) {
// Key exists
}
// Delete a value
final wasDeleted = await storage.delete('auth.token');
See also:
SecureStoragePlugin
- The base plugin interfaceInitOncePlugin
- Mixin for plugin initialization
- Inheritance
-
- Object
- Plugin
- SecureStoragePlugin
- FlutterSecureStoragePlugin
- Mixed-in types
-
- InitOncePlugin
Constructors
- FlutterSecureStoragePlugin.new({AndroidOptions? androidOptions, IOSOptions? iOSOptions, WebOptions? webOptions, MacOsOptions? macOSOptions, LinuxOptions? linuxOptions, WindowsOptions? windowsOptions})
- Creates a new instance of FlutterSecureStoragePlugin with platform-specific options.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialized → bool
-
no setterinherited
- name → String
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String
-
finalinherited
Methods
-
delete(
String key) → Future< bool> -
Deletes a value from secure storage.
override
-
dispose(
) → Future< void> -
inherited
-
disposeOnce(
) → Future< void> -
override
-
has(
String key) → Future< bool> -
Checks if a key exists in secure storage.
override
-
init(
) → Future< void> -
inherited
-
initOnce(
) → Future< void> -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String key) → Future< String?> -
Reads a value from secure storage.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
String key, dynamic value) → Future< void> -
Writes a value to secure storage.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited