UserDefaults class

Surface level API for the user defaults plugin.

Constructors

UserDefaults()

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 Properties

appGroup ← String
Sets the app group to use for the user defaults.
no getter

Static Methods

contains(String key, String appGroup) → Future<bool>
Returns true if the user defaults contains a value associated with key.
get(String key, [String? appGroup]) → Future<Object?>
Returns the value associated with key or null if no value is associated with key.
getBool(String key, String appGroup) → Future<bool?>
Returns the value associated with key or null if no value is associated with key.
getDouble(String key, String appGroup) → Future<double?>
Returns the value associated with key or null if no value is associated with key.
getInt(String key, String appGroup) → Future<int?>
Returns the value associated with key or null if no value is associated with key.
getString(String key, String appGroup) → Future<String?>
Returns the value associated with key or null if no value is associated with key.
remove(String key, String appGroup) → Future<void>
Removes the value associated with key from the user defaults
set(String key, dynamic value, String appGroup) → Future<void>
Stores value in the user defaults key-value store.
setBool(String key, bool value, String appGroup) → Future<void>
Stores value in the user defaults key-value store.
setDouble(String key, double value, String appGroup) → Future<void>
Stores value in the user defaults key-value store.
setInt(String key, int value, String appGroup) → Future<void>
Stores value in the user defaults key-value store.
setString(String key, String value, String appGroup) → Future<void>
Stores value in the user defaults key-value store.