SPWithDefault<T extends Object> class

Represents a shared preference entry with a default value.

The value getter will return the defaultValue if the value is not found in shared preferences.

Inheritance

Constructors

SPWithDefault({required SharedPrefGetter<T> getter, required SharedPrefSetter<T> setter, required SharedPrefRemover remover, required String key, required T defaultValue})
const

Properties

defaultValue → T
final
hashCode int
The hash code for this object.
no setterinherited
key String
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
Decoded value, stored in shared preferences.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove() Future<bool>
Remove value from shared preferences.
inherited
setValue(T value) Future<bool>
Set value to shared preferences.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited