SpUtil class

SharedPreferences Util.

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

clear() Future<bool>?
clear.
containsKey(String key) bool?
contains Key.
getBool(String key, {bool? defValue = false}) bool?
get bool.
getDouble(String key, {double? defValue = 0.0}) double?
get double.
getDynamic(String key, {Object? defValue}) → dynamic
get dynamic.
getInstance() Future<SpUtil?>
getInt(String key, {int? defValue = 0}) int?
get int.
getKeys() Set<String>?
get keys.
getObj<T>(String key, T f(Map v), {T? defValue}) → T?
get obj.
getObject(String key) Map?
get object.
getObjectList(String key) List<Map>?
get object list.
getObjList<T>(String key, T f(Map v), {List<T>? defValue = const []}) List<T>?
get obj list.
getSp() → SharedPreferences?
get Sp.
getString(String key, {String? defValue = ''}) String?
get string.
getStringList(String key, {List<String>? defValue = const []}) List<String>?
get string list.
haveKey(String key) bool?
have key.
isInitialized() bool
Sp is initialized.
putBool(String key, bool value) Future<bool>?
put bool.
putDouble(String key, double value) Future<bool>?
put double.
putInt(String key, int value) Future<bool>?
put int.
putObject(String key, Object value) Future<bool>?
put object.
putObjectList(String key, List<Object> list) Future<bool>?
put object list.
putString(String key, String value) Future<bool>?
put string.
putStringList(String key, List<String> value) Future<bool>?
put string list.
reload() Future<void>?
Fetches the latest values from the host platform.
remove(String key) Future<bool>?
remove.