I am using the following plugin to share files in my flutter app:
[Flutter Share Plugin][1]
Here's how I use it my code:
new IconButton(icon: new Icon(FontAwesomeIcons.download, size: 35),
onPressed: () {
final RenderBox box = context.findRenderObject();
Share.image(path: "file:../assets/lake.jpg",mimeType: ShareType.TYPE_IMAGE,title: "title",text:"text").share(
sharePositionOrigin: box.localToGlobal(Offset.zero) & box.size);
},
),"SHARE"),
Notice the path is set to ../assets/lake.jpg. This is because this dart file resides under lib/pages folder whereas the picture that I am trying to access is under assets folder.
Here's the screenshot:
When I click on the share button, the share box comes up and when I try to share the image via whatsapp for example, it even asks me "Share with Mr. X"?
However, it does not share anything and does not give me any sort of error message.