MapPrefNotifier<T> class
Converts the value of type parameter T
to a String and persists
it in SharedPreferences.
To update the value, use the update() function. Direct assignment to state cannot be used.
await watch(mapPrefProvider.notifier).update(v);
Constructors
- MapPrefNotifier(String prefKey, T mapFrom(String?), String mapTo(T))
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- mapFrom ↔ T Function(String?)
-
getter/setter pair
- mapTo ↔ String Function(T)
-
getter/setter pair
- prefKey ↔ String
-
getter/setter pair
- prefs ↔ dynamic
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state ← T
-
Do not use the setter for state.
Instead, use
await update(value).
no getter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
T value) → Future< void> - Updates the value asynchronously.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited