Persistor<St> class

Use it like this:

var persistor = MyPersistor();

var initialState = await persistor.readState();

if (initialState == null) {
initialState = AppState.initialState();
await persistor.saveInitialState(initialState);
}

var store = Store<AppState>(
  initialState: initialState,
  persistor: persistor,
);
Implementers

Constructors

Persistor()

Properties

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
throttle Duration
The default throttle is 2 seconds. Pass null to turn off throttle.
read-only

Methods

deleteState() Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
persistDifference({St lastPersistedState, St newState}) Future<void>
readState() Future<St>
saveInitialState(St state) Future<void>
toString() String
Returns a string representation of this object.
inherited

Operators

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