ChatMessage constructor

const ChatMessage({
  1. required String id,
  2. required String chatId,
  3. required String authorId,
  4. required String authorDisplayName,
  5. String? authorAvatarUrl,
  6. required String text,
  7. required DateTime createdAt,
  8. DateTime? updatedAt,
  9. bool isSystem = false,
  10. bool isDeleted = false,
  11. String? replyToMessageId,
  12. ChatReplySnapshot? replyToSnapshot,
})

Creates a new ChatMessage.

Required parameters:

  • id: Unique identifier
  • chatId: ID of the chat
  • authorId: ID of the message author
  • authorDisplayName: Display name of the author
  • text: Message text content
  • createdAt: Creation date and time

Optional parameters:

  • authorAvatarUrl: Avatar URL for the author
  • updatedAt: Last update date and time
  • isSystem: Whether this is a system message (default: false)
  • isDeleted: Whether this message is deleted (default: false)
  • replyToMessageId: ID of the message being replied to
  • replyToSnapshot: Snapshot of the replied message

Implementation

const ChatMessage({
  required this.id,
  required this.chatId,
  required this.authorId,
  required this.authorDisplayName,
  this.authorAvatarUrl,
  required this.text,
  required this.createdAt,
  this.updatedAt,
  this.isSystem = false,
  this.isDeleted = false,
  this.replyToMessageId,
  this.replyToSnapshot,
});