removeAttachmentById method

void removeAttachmentById(
  1. String attachmentId
)

Remove the attachment with the given attachmentId.

Implementation

void removeAttachmentById(String attachmentId) {
  attachments = [...attachments]..removeWhere((it) => it.id == attachmentId);
}