RealRxStorage<Key extends Object, Options, S extends Storage<Key, Options>> class

Default RxStorage implementation.

Implemented types

Constructors

RealRxStorage(FutureOr<S> storageOrFuture, [RxStorageLogger<Key, Options>? logger, void _onDispose()?])
Construct a RealRxStorage.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear([Options? options]) Future<void>
Completes with true once the storage for the app has been cleared.
override
containsKey(Key key, [Options? options]) Future<bool>
Returns a future complete with value true if the persistent storage contains the given key.
override
dispose() Future<void>
Clean up resources - Closes the streams.
override
enqueueWritingTask<T>(Key? key, AsyncQueueBlock<T> block) Future<T>
Enqueue writing task to a AsyncQueue.
executeUpdate<T extends Object>(Key key, Decoder<T?> decoder, Transformer<T?> transformer, Encoder<T?> encoder, [Options? options]) Future<void>
Read–modify–write.
override
logIfEnabled(RxStorageLoggerEvent<Key, Options> eventProducer()) → void
Log event if logging is enabled.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe<T extends Object>(Key key, Decoder<T?> decoder, [Options? options]) Stream<T?>
Return Stream that will emit value read from persistent storage. It will automatic emit value when value associated with key was changed.
override
observeAll([Options? options]) Stream<Map<Key, Object?>>
Return Stream that will emit all values associated with key read from persistent storage. It will automatic emit all keys when any value was changed.
override
read<T extends Object>(Key key, Decoder<T?> decoder, [Options? options]) Future<T?>
Reads a value of any type from persistent storage.
override
readAll([Options? options]) Future<Map<Key, Object?>>
Returns all keys in the persistent storage.
override
remove(Key key, [Options? options]) Future<void>
Removes an entry from persistent storage.
override
sendChange(Map<Key, KeyAndValue<Key, Object?>> map) → void
Add changed map to subject to trigger.
toString() String
A string representation of this object.
inherited
update<T extends Object>({required Key key, required Decoder<T?> decoder, required Transformer<T?> transformer, required Encoder<T?> encoder, Options? options}) Future<void>
Read–modify–write.
override
useStorageWithHandlers<R>(Future<R> block(S), FutureOr<void> onSuccess(R, S)?, FutureOr<void> onFailure(RxStorageError, S)?) Future<R>
Calling block with S as argument.
write<T extends Object>(Key key, T? value, Encoder<T?> encoder, [Options? options]) Future<void>
Saves a value to persistent storage.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited