rx_shared_preferences library

Author: Petrus Nguyễn Thái Học.

Reactive shared preferences for Flutter.

Classes

ClearFailureEvent<Key extends Object, Options>
Clear storage failed.
ClearSuccessEvent<Key extends Object, Options>
Clear storage successfully.
KeyAndValue<K extends Object, V>
Pair of key and value.
KeysChangedEvent<Key extends Object, Options>
Key changed when mutating storage.
OnDataStreamEvent<Key extends Object, Options>
Stream emits new data event.
OnErrorStreamEvent<Key extends Object, Options>
Stream emits error event.
ReadAllFailureEvent<Key extends Object, Options>
Read all values failed.
ReadAllSuccessEvent<Key extends Object, Options>
Read all values successfully.
ReadValueFailureEvent<Key extends Object, Options>
Read value failed.
ReadValueSuccessEvent<Key extends Object, Options>
Read value successfully.
RealRxStorage<Key extends Object, Options, S extends Storage<Key, Options>>
Default RxStorage implementation.
ReloadFailureEvent
Reload failed.
ReloadSuccessEvent
Reload successfully.
RemoveFailureEvent<Key extends Object, Options>
Remove failed.
RemoveSuccessEvent<Key extends Object, Options>
Remove successfully.
RxSharedPreferences
Get Streams by key from persistent storage.
RxSharedPreferencesConfigs
Global configs for default singleton or extension.
RxSharedPreferencesDefaultLogger
Default RxSharedPreferencesLogger's implementation, simply print to the console.
RxSharedPreferencesEmptyLogger
Log nothing :)
RxSharedPreferencesLogger
Log messages about operations (such as read, write, value change) and stream events. Must handle ReloadSuccessEvent and ReloadFailureEvent.
RxStorage<Key extends Object, Options>
Get Streams by key from persistent storage.
RxStorageDefaultLogger<Key extends Object, Options>
Default Logger's implementation, simply print to the console.
RxStorageEmptyLogger<Key extends Object, Options>
Log nothing :)
RxStorageError
An Object which acts as a tuple containing both an error and the corresponding stack trace.
RxStorageLogger<Key extends Object, Options>
Log messages about operations (such as read, write, value change) and stream events.
RxStorageLoggerEvent<Key extends Object, Options>
Event when reading, writing storage.
SharedPreferences
Wraps NSUserDefaults (on iOS) and SharedPreferences (on Android), providing a persistent store for simple data.
SharedPreferencesLike
Wraps NSUserDefaults (on iOS) and SharedPreferences (on Android), providing a persistent store for simple data.
Storage<Key extends Object, Options>
A persistent store for simple data. Data is persisted to disk asynchronously.
TransactionalStorage<Key extends Object, Options>
A persistent store for simple data. Data is persisted to disk asynchronously and transactionally.
WriteFailureEvent<Key extends Object, Options>
Write failed.
WriteSuccessEvent<Key extends Object, Options>
Write successfully.

Extensions

MapToListOfKeyAndValuesExtension on Map<Key, Object?>
Convert a map to list of KeyAndValues.
RxSharedPreferencesExtension on RxSharedPreferences
Extensions for primitive type
SharedPreferencesExtensions on SharedPreferencesLike
Extensions for primitive type
SharedPreferencesRxExtension on SharedPreferences
Provide RxSharedPreferences via rx getter.

Typedefs

Decoder<T> = FutureOr<T> Function(Object? o)
Convert storage persisted type to T. This is used in Storage.read.
Encoder<T> = FutureOr<Object?> Function(T t)
Convert T to a value of type that can be persisted in Storage. This is used in Storage.write.
Transformer<T> = FutureOr<T> Function(T)
Transform a value to another value of the same type.