ActivitySnapshotEvent class abstract

ACTIVITY_SNAPSHOT — a frontend-only structured-UI element (progress bar, checklist, …) keyed by messageId and activityType. Activity content never reaches the agent; it is rendered by the consumer surface (Epic 6/7).

content is the full activity payload (Record<string, any> on the wire); the nested object is compared deeply via freezed's DeepCollectionEquality. replace mirrors the wire flag (defaulting to true on the wire) but is not defaulted here: an absent flag stays null so the round-trip is lossless, and the snapshot-vs-merge decision is left to the consumer.

Inheritance
Available extensions
Annotations
  • @freezed

Constructors

ActivitySnapshotEvent({required String messageId, required String activityType, required Map<String, dynamic> content, bool? replace})
Constructs an ACTIVITY_SNAPSHOT event keyed by messageId and activityType, carrying the full content and optional replace flag.
const
factory

Properties

activityType String
no setterinherited
content Map<String, dynamic>
no setterinherited
copyWith → $ActivitySnapshotEventCopyWith<ActivitySnapshotEvent>
Create a copy of ActivitySnapshotEvent with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
messageId String
no setterinherited
replace bool?
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_ActivitySnapshotEvent value)) → TResult

Available on ActivitySnapshotEvent, provided by the ActivitySnapshotEventPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_ActivitySnapshotEvent value)?) → TResult?

Available on ActivitySnapshotEvent, provided by the ActivitySnapshotEventPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_ActivitySnapshotEvent value)?, {required TResult orElse()}) → TResult

Available on ActivitySnapshotEvent, provided by the ActivitySnapshotEventPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String messageId, String activityType, Map<String, dynamic> content, bool? replace)?, {required TResult orElse()}) → TResult

Available on ActivitySnapshotEvent, provided by the ActivitySnapshotEventPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes to the ACTIVITY_SNAPSHOT wire shape.
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String messageId, String activityType, Map<String, dynamic> content, bool? replace)) → TResult

Available on ActivitySnapshotEvent, provided by the ActivitySnapshotEventPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String messageId, String activityType, Map<String, dynamic> content, bool? replace)?) → TResult?

Available on ActivitySnapshotEvent, provided by the ActivitySnapshotEventPatterns extension

A variant of when that fallback to returning null

Operators

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

Static Methods

fromJson(Map<String, dynamic> json) ActivitySnapshotEvent
Decodes an ACTIVITY_SNAPSHOT wire payload. Throws ProtocolError(protocolMalformed) when messageId/activityType is absent or content is absent/not a JSON object; a present non-bool replace is likewise rejected (absent replace decodes to null).