addAttachment method

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

Implementation

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