removeAttachmentById method

void removeAttachmentById(
  1. String attachmentId
)

Remove the attachment with the given attachmentId.

Implementation

void removeAttachmentById(String attachmentId) {
  final attachment = value.firstWhereOrNull(
    (attachment) => attachment.id == attachmentId,
  );

  if (attachment == null) return;

  removeAttachment(attachment);
}