FlutterSecureStorage class

Constructors

FlutterSecureStorage({IOSOptions iOptions = IOSOptions.defaultOptions, AndroidOptions aOptions = AndroidOptions.defaultOptions, LinuxOptions lOptions = LinuxOptions.defaultOptions, WindowsOptions wOptions = WindowsOptions.defaultOptions, WebOptions webOptions = WebOptions.defaultOptions, MacOsOptions mOptions = MacOsOptions.defaultOptions})
const

Properties

aOptions AndroidOptions
final
hashCode int
The hash code for this object.
no setterinherited
iOptions IOSOptions
final
lOptions LinuxOptions
final
mOptions MacOsOptions
final
onCupertinoProtectedDataAvailabilityChanged Stream<bool>?
iOS only feature
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
webOptions WebOptions
final
wOptions WindowsOptions
final

Methods

containsKey({required String key, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions}) Future<bool>
Returns true if the storage contains the given key.
delete({required String key, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions}) Future<void>
Deletes associated value for the given key.
deleteAll({IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions}) Future<void>
Deletes all keys with associated values.
isCupertinoProtectedDataAvailable() Future<bool?>
iOS and macOS only feature.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read({required String key, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions}) Future<String?>
Decrypts and returns the value for the given key or null if key is not in the storage.
readAll({IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions}) Future<Map<String, String>>
Decrypts and returns all keys with associated values.
registerListener({required String key, required ValueChanged<String?> listener}) → void
Register listener for key with the value injected for the listener. The listener will still be called when you delete the key with the injected value as null. This listener will be added to the list of registered listeners for that key.
toString() String
A string representation of this object.
inherited
unregisterAllListeners() → void
Unregister all listeners for all keys.
unregisterAllListenersForKey({required String key}) → void
Unregister all listeners for key.
unregisterListener({required String key, required ValueChanged<String?> listener}) → void
Unregister listener for Key. The other registered listeners for key will be remained.
write({required String key, required String? value, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions}) Future<void>
Encrypts and saves the key with the given value.

Operators

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

Static Methods

setMockInitialValues(Map<String, String> values) → void
Initializes the shared preferences with mock values for testing.

Constants

UNSUPPORTED_PLATFORM → const String