AppPreference class
Shared preferences wrapper used for simple key-value persistence.
Constructors
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
- Clears all keys and resets the PrefKey.user flag.
-
getBoolean(
String key) → bool -
Reads a boolean for
keyor returnsfalse. -
getDouble(
String key) → double -
Reads a double for
keyor returns0.0. -
getInt(
String key) → int -
Reads an integer for
keyor returns0. -
getLong(
String key) → double -
Reads a large numeric value as double for
key. -
getString(
String key) → String -
Reads a string for
keyor returns an empty value. -
Initializes the singleton
SharedPreferencesinstance. -
Removes a single value by
key. -
setBoolean(
String key, {required bool value}) → Future -
Saves a boolean
valueforkey. -
setDouble(
String key, double value) → Future -
Saves a double
valueforkey. -
setInt(
String key, int value) → Future -
Saves an integer
valueforkey. -
setLong(
String key, double value) → Future -
Saves a large numeric value as double for
key. -
setString(
String key, String value) → Future -
Saves a string
valueforkey.