attachFile method

FileAttachment attachFile(
  1. String path, {
  2. String? mimeType,
  3. String? displayName,
})

Implementation

FileAttachment attachFile(String path, {String? mimeType, String? displayName}) {
  final attachment = FileAttachment(path: path, mimeType: mimeType, displayName: displayName, initialStatus: UploadStatus.completed);
  attachment.addListener(notifyListeners);
  _attachmentUploads.add(attachment);
  notifyListeners();
  return attachment;
}