Message constructor

const Message({
  1. required String id,
  2. required String conversationId,
  3. required String senderId,
  4. required MessageContent content,
  5. required DateTime clientTimestamp,
  6. String? serverId,
  7. String? senderName,
  8. String? senderAvatar,
  9. String? anonymousName,
  10. String? anonymousAvatar,
  11. MessageType type = MessageType.text,
  12. MessageStatus status = MessageStatus.pending,
  13. DateTime? serverTimestamp,
  14. String? replyToId,
  15. Message? replyTo,
  16. List<FileAttachment> attachments = const [],
  17. List<Reaction> reactions = const [],
  18. List<String> readBy = const [],
  19. bool isDeleted = false,
  20. bool isEdited = false,
  21. bool isStarred = false,
  22. bool isPinned = false,
  23. DateTime? pinnedUntil,
  24. int localSequence = 0,
  25. Map<String, dynamic>? metadata,
})

Creates a message.

Implementation

const Message({
  required this.id,
  required this.conversationId,
  required this.senderId,
  required this.content,
  required this.clientTimestamp,
  this.serverId,
  this.senderName,
  this.senderAvatar,
  this.anonymousName,
  this.anonymousAvatar,
  this.type = MessageType.text,
  this.status = MessageStatus.pending,
  this.serverTimestamp,
  this.replyToId,
  this.replyTo,
  this.attachments = const [],
  this.reactions = const [],
  this.readBy = const [],
  this.isDeleted = false,
  this.isEdited = false,
  this.isStarred = false,
  this.isPinned = false,
  this.pinnedUntil,
  this.localSequence = 0,
  this.metadata,
});