addAttachment method

void addAttachment(
  1. Attachment attachment
)

Adds a new attachment to the message.

Implementation

void addAttachment(Attachment attachment) {
  attachments = [...attachments, attachment];
}