Message class

A chat message returned by a server-backed chat flow.

Constructors

Message({String? id, required User user, required int userId, required String content, required String flow, required String role, required int threadId, dynamic widgetDefination, int? createdAt, int? updatedAt})
Creates a chat message model.
Message.fromJson(Map<String, dynamic> json)
Creates a Message from JSON-like map data.
factory

Properties

content ↔ String
Message body.
getter/setter pair
createdAt → int?
Creation timestamp.
final
flow → String
Flow identifier associated with this message.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String?
Message identifier.
final
role → String
Role associated with this message.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
threadId → int
Thread identifier for the message.
final
updatedAt → int?
Last updated timestamp.
final
user → User
User that authored the message.
final
userId → int
Numeric user identifier.
final
widgetDefination → dynamic
Optional inline widget definition.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this message to JSON-like map data.
toString() → String
A string representation of this object.
inherited

Operators

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