toggleAttachment method
Implementation
void toggleAttachment(Attachment attachment, bool active) {
attachments[attachments.indexOf(attachment)].active = active;
attachments.refresh();
allAttachmentsDisabled.value = !attachments.any(
(Attachment attachment) => attachment.active,
);
update();
}