addAttachmentAt method

void addAttachmentAt(
  1. int index,
  2. Attachment attachment
)

Adds a new attachment at the specified index.

Implementation

void addAttachmentAt(int index, Attachment attachment) {
  attachments = [...attachments]..insert(index, attachment);
}