shared_preferences_riverpod library

Classes

MapPrefNotifier<T>
Converts the value of type parameter T to a String and persists it in SharedPreferences.
PrefNotifier<T>
The type parameter T is the type of value that will be persisted in SharedPreferences.

Functions

createMapPrefProvider<T>({required SharedPreferences prefs(Ref<Object?>), required String prefKey, required T mapFrom(String?), required String mapTo(T)}) → StateNotifierProvider<MapPrefNotifier<T>, T>
Returns a Provider that can access the preference with any type you want.
createPrefProvider<T>({required SharedPreferences prefs(Ref<Object?>), required String prefKey, required T defaultValue}) → StateNotifierProvider<PrefNotifier<T>, T>
Returns the Provider that has access to the value of preferences.