downloadAttachment static method

Future<void> downloadAttachment(
  1. Attachment? attachment
)

Implementation

static Future<void> downloadAttachment(Attachment? attachment) async {
  if (attachment == null) return;
  String? content = await readAttachmentContent(attachment.id);
  if (content == null) return;
  FileService.saveToDownloads(
      content, attachment.fileName, attachment.extension);
}