SaveManager<T> class

Coordinates saving, loading, and migrations for a payload type.

Constructors

SaveManager({required SaveStore store, required SaveCodec codec, required Migrator migrator, required Map<String, dynamic> encoder(T value), required T decoder(Map<String, dynamic> payload), SaveStore? backupStore, Clock? clock, Checksum checksum = const Checksum(), bool useChecksum = true, bool verifyChecksum = true, bool validatePayload = true})
Creates a save manager.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

load() Future<LoadResult<T>>
Loads the current save without writing it back.
migrateIfNeeded() Future<LoadResult<T>>
Loads and persists the migrated save when needed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(T value, {required SaveContext context}) Future<SaveResult>
Saves a new value with an explicit context.
toString() String
A string representation of this object.
inherited

Operators

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