JsonFilePersistence<State> class

Stores the state into a file as JSON content.

Inheritance

Constructors

JsonFilePersistence({@required AsyncFileGetter file, @required JsonConverter<State> converter})
Create a new persistence layer with file and converter.
const

Properties

converter JsonConverter<State>
The converter used to serialize and deserialize JSON.
final
file AsyncFileGetter
The asynchronous file accessor.
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

clear() Future<void>
Clear the state from the storage.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
read() Future<State>
Reads the state from storage.
override
toString() String
A string representation of this object. [...]
inherited
write(State state) Future<void>
Write the state to the storage.
override

Operators

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