PrefNotifier<T> class

The type parameter T is the type of value that will be persisted in SharedPreferences.

To update the value, use the update() function. Direct assignment to state cannot be used.

await watch(booPrefProvider.notifier).update(v);

Constructors

PrefNotifier(String prefKey, T defaultValue)

Properties

defaultValue ↔ T
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
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