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
hashCode int
The hash code for this object. [...]
read-only, inherited
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
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
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

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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
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.
toString() String
Returns a string representation of this object.
inherited

Operators

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