AiChatMessage class

A single message in the AI assistant chat conversation.

Constructors

AiChatMessage({required String id, required AiMessageRole role, required String content, required DateTime timestamp, List<AgentAction>? actions, bool isVoice = false, List<ChatContent>? richContent, bool buttonsDisabled = false, int tappedButtonIndex = -1})
AiChatMessage.fromJson(Map<String, dynamic> json)
factory

Properties

actions → List<AgentAction>?
Actions the AI performed as part of this response (for display purposes).
final
buttonsDisabled ↔ bool
Whether interactive buttons in this message have been disabled (e.g. after the user tapped one). Mutable so the controller can disable buttons without recreating the message.
getter/setter pair
content → String
Plain text content. Always present as the base message.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
final
isVoice → bool
Whether this message originated from voice input.
final
richContent → List<ChatContent>?
Rich content blocks (text, images, buttons, cards).
final
role → AiMessageRole
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tappedButtonIndex ↔ int
The index of the button that was tapped (for highlight styling). -1 means no button was tapped.
getter/setter pair
timestamp → DateTime
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializzazione per la persistenza conversazioni. Volutamente MINIMALE: id, role, content, timestamp, isVoice. actions/richContent (rendering transitorio: card tool, bottoni) NON persistono → al reload il messaggio si rende come testo semplice.
toString() → String
A string representation of this object.
inherited

Operators

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