watchDouble static method

PreferenceNotifier<double> watchDouble(
  1. Ref<Object?> ref,
  2. String key, {
  3. required double defaultValue,
})

Preference notifier that starts with the current double 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<double> watchDouble(
  Ref ref,
  String key, {
  required double defaultValue,
}) {
  return SharedPreferenceNotifier._(
    ref,
    (sharedPref) => sharedPref.getDouble(key, defaultValue: defaultValue),
    defaultValue,
  );
}