Snapshot constructor

const Snapshot({
  1. required DateTime timestamp,
  2. required String appVersion,
  3. required int schemaVersion,
  4. required Map<String, dynamic> states,
  5. Map<String, dynamic>? metadata,
})

Creates a new snapshot with the given fields.

Required fields:

  • timestamp: The UTC timestamp when the snapshot was created
  • appVersion: The version string of the app (e.g., "1.2.3")
  • schemaVersion: The version of the snapshot schema (currently 1)
  • states: Map of state keys to their JSON-serializable state data

Optional fields:

  • metadata: Optional map of custom metadata. Must be JSON-serializable. Useful for tagging snapshots with bug IDs, reporter names, or other contextual information.

Implementation

const Snapshot({
  required this.timestamp,
  required this.appVersion,
  required this.schemaVersion,
  required this.states,
  this.metadata,
});