watchStringList static method

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

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