watchCustomValue<T> static method
- Ref<
Object?> ref, - String key, {
- required T defaultValue,
- required PreferenceAdapter<
T> adapter,
Preference notifier that starts with the current custom value for the
given key, then emits a new value every time there are chanegs to the
value associated with the given key.
Implementation
static PreferenceNotifier<T> watchCustomValue<T>(
Ref ref,
String key, {
required T defaultValue,
required PreferenceAdapter<T> adapter,
}) {
return SharedPreferenceNotifier._(
ref,
(sharedPref) => sharedPref.getCustomValue(
key,
defaultValue: defaultValue,
adapter: adapter,
),
defaultValue,
);
}