Message constructor

const Message({
  1. required String id,
  2. required String accountId,
  3. required String msgid,
  4. @Default('') String intro,
  5. required Map<String, String> from,
  6. required List<Map<String, String>> to,
  7. @Default([]) List<String> cc,
  8. @Default([]) List<String> bcc,
  9. @Default('') String subject,
  10. required bool seen,
  11. @Default(false) bool flagged,
  12. required bool isDeleted,
  13. @Default({}) Map<String, dynamic> verifications,
  14. @Default(false) bool retention,
  15. DateTime? retentionDate,
  16. @Default('') String text,
  17. @Default([]) List<String> html,
  18. required bool hasAttachments,
  19. @Default([]) List<Attachment> attachments,
  20. required int size,
  21. required String downloadUrl,
  22. required DateTime createdAt,
  23. required DateTime updatedAt,
})

Message constructor. MUST NOT be used manually Use MailTm and AuthorizedUser

Implementation

const factory Message({
  /// The unique identifier of the message (MailTm DB).
  required String id,

  /// The unique identifier of the account.
  required String accountId,

  /// The unique identifier of the message
  /// (Global, both the receiver service and MailTm will know this).
  required String msgid,

  /// The introduction of the message.
  @Default('') String intro,

  /// The sender of the message.
  required Map<String, String> from,

  /// The recipients of the message.
  required List<Map<String, String>> to,

  /// The carbon copy recipients of the message.
  @Default([]) List<String> cc,

  /// The blind carbon copy recipients of the message.
  @Default([]) List<String> bcc,

  /// The subject of the message.
  @Default('') String subject,

  /// Whether the message has been seen.
  required bool seen,

  /// Whether the message has been flagged.
  @Default(false) bool flagged,

  /// Whether the message has been deleted.
  required bool isDeleted,

  /// The verifications of the message.
  @Default({}) Map<String, dynamic> verifications,

  /// If the message has arrived
  @Default(false) bool retention,

  /// The date of the message retention.
  DateTime? retentionDate,

  /// The text of the message.
  @Default('') String text,

  /// The HTML of the message.
  @Default([]) List<String> html,

  /// Whether the message has attachments.
  required bool hasAttachments,

  /// List of the message.
  @Default([]) List<Attachment> attachments,

  /// The size of the message.
  required int size,

  /// The downloadUrl of the message.
  required String downloadUrl,

  /// The date of the message creation.
  required DateTime createdAt,

  /// When the message was seen
  required DateTime updatedAt,
}) = _Message;