Persistor<T> class

Persistor class that saves/loads to/from disk.

Constructors

Persistor({StorageEngine storage, Decoder<T> decoder, Encoder<T> encoder, int version: -1, Map<int, Migration> migrations, Transforms<T> transforms, RawTransforms rawTransforms, bool debug: false })
Create a persistor.

Properties

debug ↔ bool
Debug mode (prints debug information).
read / write
decoder Decoder<T>
Decoder to map a Map (from JSON) to T
final
encoder Encoder<T>
Encoder to map a T to encodable.
final
errorStream → Stream
Stream of errors on save/load.
read-only
loaded → bool
If state has loaded.
read-only
loadStream → Stream<T>
Stream of states after a load.
read-only
migrations → Map<int, Migration>
State migrations between versions.
final
rawTransforms RawTransforms
Transforamtions on raw state (JSON) to be applied on save/load.
final
storage StorageEngine
Storage engine to save/load from/to.
final
transforms Transforms<T>
Transformations on state to be applied on save/load.
final
version → int
State version.
final
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createMiddleware() Middleware<T>
Middleware used for Redux which saves on each action.
load(Store<T> store) → Future<T>
Load state.
loadFromStorage() → Future<T>
Load state from storage. Use load.
save(Store<T> store) → Future<void>
Save state.
saveToStorage(T state) → Future<void>
Save state to storage. Use save.
start(Store<T> store) → Future<T>
Use load.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited