SnapshotManager class

Orchestrates snapshot capture and restore logic.

The SnapshotManager coordinates with SnapshotRegistry to collect state from all registered contributors and create a Snapshot instance, as well as restore state from snapshots.

Key Responsibilities:

  • Collect state from all registered contributors in deterministic order
  • Create Snapshot instances with proper metadata
  • Restore state from snapshots in deterministic order
  • Handle errors during capture and restore gracefully

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

capture(String appVersion, {Map<String, dynamic>? metadata, List<String>? keys}) Snapshot
Creates a snapshot by collecting state from all registered contributors.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restore(Snapshot snapshot, {List<String>? keys, bool continueOnError = false}) → void
Restores state from a snapshot.
toString() String
A string representation of this object.
inherited
validateSnapshot(Snapshot snapshot) SnapshotValidationResult
Validates a snapshot before restoring it.

Operators

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

Static Properties

instance SnapshotManager
Get the singleton instance.
no setter

Constants

schemaVersion → const int
Current schema version for snapshots.