Sometimes we want to add a simple, short blob of data, like a text, as an attachment. Currently in order to do that, we have to create a temporary file and provide a path of that file as an argument. It would be easier and more efficient if we could provide the contents of an attachment directly using Uint8List, along with file name and the content type.
On iOS this seems easy, as the MFMailComposeViewController already takes these exact parameters, it's just a matter of exposing this interface.
On Android, I've found this snippet: https://gist.github.com/lifeisfoo/6058056d946dadb477b7 but I am an iOS engineer by experience, so I can't verify if this implementation is correct - this is the main reason why I don't feel qualified to implement this feature myself.
The current way feels like unnecessary overhead.
Sometimes we want to add a simple, short blob of data, like a text, as an attachment. Currently in order to do that, we have to create a temporary file and provide a path of that file as an argument. It would be easier and more efficient if we could provide the contents of an attachment directly using Uint8List, along with file name and the content type.
On iOS this seems easy, as the
MFMailComposeViewControlleralready takes these exact parameters, it's just a matter of exposing this interface.On Android, I've found this snippet: https://gist.github.com/lifeisfoo/6058056d946dadb477b7 but I am an iOS engineer by experience, so I can't verify if this implementation is correct - this is the main reason why I don't feel qualified to implement this feature myself.
The current way feels like unnecessary overhead.