watchEnum<T extends Enum> static method
Preference notifier that starts with the current enum 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> watchEnum<T extends Enum>(
Ref ref,
String key, {
required T defaultValue,
required List<T> values,
}) {
return SharedPreferenceNotifier._(
ref,
(sharedPref) => sharedPref.getCustomValue(
key,
defaultValue: defaultValue,
adapter: EnumAdapter(values),
),
defaultValue,
);
}