addAttachmentWithFile method

Future<Attachment> addAttachmentWithFile({
  1. required String name,
  2. required String contentType,
  3. required Uri fileUri,
  4. String keywords = '',
})

Adds a new attachment, with keywords, to this feature from the specified file.

One of the following error codes may be set:

Parameters:

  • name — The name of the Attachment.
  • contentType — The type of content.
  • fileUri — Path to a file that will be used for the attachment's content.
  • keywords — Attachment keywords. The attachment keywords can be accessed using Attachment.keywords.

Return Value: The new Attachment that was added to this feature.