AppPreference class

Shared preferences wrapper used for simple key-value persistence.

Constructors

AppPreference()

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

clearSharedPreferences() → void
Clears all keys and resets the PrefKey.user flag.
getBoolean(String key) bool
Reads a boolean for key or returns false.
getDouble(String key) double
Reads a double for key or returns 0.0.
getInt(String key) int
Reads an integer for key or returns 0.
getLong(String key) double
Reads a large numeric value as double for key.
getString(String key) String
Reads a string for key or returns an empty value.
initMySharedPreferences() Future
Initializes the singleton SharedPreferences instance.
removeSharedPreference(String key) → void
Removes a single value by key.
setBoolean(String key, {required bool value}) Future
Saves a boolean value for key.
setDouble(String key, double value) Future
Saves a double value for key.
setInt(String key, int value) Future
Saves an integer value for key.
setLong(String key, double value) Future
Saves a large numeric value as double for key.
setString(String key, String value) Future
Saves a string value for key.