Message.textStream constructor
const
Message.textStream({
- required String id,
- required String authorId,
- String? replyToMessageId,
- @EpochDateTimeConverter() DateTime? createdAt,
- @EpochDateTimeConverter() DateTime? deletedAt,
- @EpochDateTimeConverter() DateTime? failedAt,
- @EpochDateTimeConverter() DateTime? sentAt,
- @EpochDateTimeConverter() DateTime? deliveredAt,
- @EpochDateTimeConverter() DateTime? seenAt,
- @EpochDateTimeConverter() DateTime? updatedAt,
- Map<
String, List< ? reactions,String> > - bool? pinned,
- Map<
String, dynamic> ? metadata, - MessageStatus? status,
- required String streamId,
Creates a streaming text message placeholder. Used while the text content is being streamed.
Implementation
const factory Message.textStream({
/// Unique identifier for the message.
required String id,
/// ID of the user (typically the AI) sending the message.
required String authorId,
/// ID of the message this one is replying to.
String? replyToMessageId,
/// Timestamp when the message was created.
@EpochDateTimeConverter() DateTime? createdAt,
/// Timestamp when the message was marked as deleted.
@EpochDateTimeConverter() DateTime? deletedAt,
/// Timestamp when the message sending failed (e.g., network error during stream).
@EpochDateTimeConverter() DateTime? failedAt,
/// Timestamp when the message was successfully sent (e.g., stream completed).
@EpochDateTimeConverter() DateTime? sentAt,
/// Timestamp when the message was fully delivered (stream completed).
@EpochDateTimeConverter() DateTime? deliveredAt,
/// Timestamp when the message was delivered to the recipient.
@EpochDateTimeConverter() DateTime? seenAt,
/// Timestamp when the message was last updated.
@EpochDateTimeConverter() DateTime? updatedAt,
/// Map of reaction keys to lists of user IDs who reacted.
Map<String, List<String>>? reactions,
/// Indicates if the message is pinned.
bool? pinned,
/// Additional custom metadata associated with the message.
Map<String, dynamic>? metadata,
/// Status of the message. Takes precedence over the timestamp based status.
/// If not provided, the status is determined by createdAt, sentAt, seenAt etc.
MessageStatus? status,
/// Identifier for the stream this message belongs to.
required String streamId,
}) = TextStreamMessage;