AppPersistor class abstract

Inheritance

Constructors

AppPersistor(String file)

Properties

file String
final
hashCode int
The hash code for this object.
no setterinherited
persist → LocalPersist?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
throttle Duration?
The default throttle is 2 seconds. Pass null to turn off throttle.
no setterinherited

Methods

deleteState() Future<void>
Delete the saved state from the persistence.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
persistDifference({required AppState? lastPersistedState, required AppState newState}) Future<void>
Save the new state to the persistence. lastPersistedState is the last state that was persisted since the app started, while newState is the new state to be persisted.
inherited
readState() Future<AppState?>
Read the saved state from the persistence. Should return null if the state is not yet persisted. This method should be called only once, when the app starts, before the store is created. The state it returns may become the store's initial-state. If some error occurs while loading the info, we have to deal with it by fixing the problem. In the worse case, if we think the state is corrupted and cannot be fixed, one alternative is deleting all persisted files and returning null.
inherited
saveInitialState(AppState state) Future<void>
Save an initial-state to the persistence.
inherited
toString() String
A string representation of this object.
inherited

Operators

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