Snapshot class

Immutable snapshot of application state.

A snapshot contains:

  • timestamp: When the snapshot was created (UTC)
  • appVersion: Version of the application that created the snapshot
  • schemaVersion: Version of the snapshot schema format
  • states: Map of state keys to their serialized state data
  • metadata: Optional custom metadata attached to the snapshot

Snapshots are immutable and can be safely shared or stored. They implement proper equality semantics based on all fields.

Constructors

Snapshot({required DateTime timestamp, required String appVersion, required int schemaVersion, required Map<String, dynamic> states, Map<String, dynamic>? metadata})
Creates a new snapshot with the given fields.
const

Properties

appVersion String
Version of the application that created this snapshot.
final
hashCode int
The hash code for this object.
no setteroverride
metadata Map<String, dynamic>?
Optional custom metadata attached to the snapshot.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schemaVersion int
Version of the snapshot schema format.
final
states Map<String, dynamic>
Map of state keys to their serialized state data.
final
timestamp DateTime
UTC timestamp when the snapshot was created.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this snapshot to a JSON-serializable map.
toJsonString({bool pretty = false}) String
Converts this snapshot to a JSON string.
toString() String
A string representation of this object.
override

Operators

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