SpUtil class
SharedPreferences Util.
Constructors
- SpUtil()
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.
-
getBool(
String key, {bool defValue = false}) → bool - get bool.
-
getDouble(
String key, {double defValue = 0.0}) → double - get double.
-
getDynamic(
String key, {required Object defValue}) → dynamic - get dynamic.
-
getInt(
String key, {int defValue = 0}) → int - get int.
-
getKeys(
) → Set< String> - get keys.
-
getObj<
T> (String key, T f(Map v), {required 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> - get obj list.
-
getString(
String key, {String defValue = ''}) → String - get string.
-
getStringList(
String key, {List< String> defValue = const []}) → List<String> - get string list.
-
hasKey(
String key) → bool - have key.
-
init(
) → dynamic -
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.
-
remove(
String key) → Future< bool> - remove.