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-valure pairs from SharedPreferences.
get(String key, {String? defaultValue}) String?
Get the string value associated with the specified key.
getBoolean(String key, {bool? defaultValue}) bool?
Get the boolean value associated with the specified key.
getDouble(String key, {double? defaultValue}) double?
Get the double value associated with the specified key.
getInt(String key, {int? defaultValue}) 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? defaultValue}) String?
Get the string value associated with the specified key.
getStringList(String key, {String? defaultValue}) List<String>?
Get the List
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.
removeWhere({bool notify = true, bool notifyEach = false, required dynamic condition(String key, String value)}) Future<bool>
Remove by checking condition.
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.
setStringList(String dataKey, List<String>? dataValue, {bool notify = true}) Future<bool>
Set the List
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.