SharedPreferences class

Interface for accessing and modifying preference data.

For any particular set of preferences, there is a single instance of this class that all clients share.

See: https://developer.android.com/reference/android/content/SharedPreferences

Constructors

SharedPreferences()

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

contains(String key) → bool
Checks whether the preferences contains a preference. [...]
get<T>(String key, [ T defaultValue ]) → T
Retrieves a value from the preferences. [...]
getAll() → Map<String, dynamic>
Retrieves all values from the preferences. [...]
getBoolean(String key, [ bool defaultValue ]) → bool
Retrieves a boolean value from the preferences. [...]
getFloat(String key, [ double defaultValue ]) → double
Retrieves a float value from the preferences. [...]
getInt(String key, [ int defaultValue ]) → int
Retrieves an int value from the preferences. [...]
getLong(String key, [ int defaultValue ]) → int
Retrieves a long value from the preferences. [...]
getString(String key, [ String defaultValue ]) → String
Retrieves a string value from the preferences. [...]
getStringSet(String key, [ Set<String> defaultValue ]) → Set<String>
Retrieves a set of string values from the preferences. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Static Methods

open(String name, [ int mode = 0 ]) → Future<SharedPreferences>
See Context.getSharedPreferences.