EncryptedSharedPreferences class

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<String>
Stream that emits a new value whenever the SharedPreferences data changes.
no setter

Methods

batch(Future<bool> invoke(BatchSharedPreferences batch), {bool notify = true}) Future<void>
Save with batch
clear({bool notify = true}) Future<bool>
Clear all key-value pairs from SharedPreferences.
get(String key) String?
Get the string value associated with the specified key.
getBoolean(String key) bool?
Get the boolean value associated with the specified key.
getDouble(String key) double?
Get the double value associated with the specified key.
getInt(String key) int?
Get the integer value associated with the specified key.
getKeys() Set<String>
Get the set of all keys stored in SharedPreferences.
getString(String key) String?
Get the string value associated with the specified key.
listen({String? key}) Stream<String>
@deprecated Use the observe() instead.
listenSet({required Set<String> keys}) Stream<String>
@deprecated Use the observeSet() instead.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyObservers() Stream<String>
Notify listeners
observe({String? key}) Stream<String>
Observe changes to the value associated with the specified key in SharedPreferences.
observeSet({required Set<String> keys}) Stream<String>
Observe changes to the values associated with the specified set of keys in SharedPreferences.
reload() Future<void>
Reload SharedPreferences data from disk.
remove(String key, {bool notify = true}) Future<bool>
Remove the value associated with the specified key from SharedPreferences.
setBoolean(String dataKey, bool? dataValue, {bool notify = true}) Future<bool>
Set the boolean value for the specified key in SharedPreferences.
setDouble(String dataKey, double? dataValue, {bool notify = true}) Future<bool>
Set the double value for the specified key in SharedPreferences.
setInt(String dataKey, int? dataValue, {bool notify = true}) Future<bool>
Set the integer value for the specified key in SharedPreferences.
setMap(Map<String, dynamic> map, {bool notify = true}) Future<void>
Save map
setString(String dataKey, String? dataValue, {bool notify = true}) Future<bool>
Set the string value for the specified key in SharedPreferences.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

getInstance() EncryptedSharedPreferences
initialize(String key, {IEncryptor? encryptor}) Future<void>
Initialize the EncryptedSharedPreferences with the provided encryption key.