addAttachment method

void addAttachment(
  1. int slotIndex,
  2. String name,
  3. Attachment attachment
)

Implementation

void addAttachment(int slotIndex, String name, Attachment attachment) {
  if (slotIndex >= attachments.length) attachments.length = slotIndex + 1;
  if (attachments[slotIndex] == null) {
    attachments[slotIndex] = <String, Attachment>{};
  }
  attachments[slotIndex]![name] = attachment;
}