How to share a file using flutter

前端 未结 7 1410
悲哀的现实
悲哀的现实 2021-02-07 09:43

I am wondering how to share a file in a flutter app?

I saw some old references to using Intents with mojo, but that no longer seems to be present. This seems like a sta

7条回答
  •  佛祖请我去吃肉
    2021-02-07 10:05

    I'm posting this reply, since the accepted answer doesn't actually answer the question.

    using flutter-share from this github repo you can share files by just adding it as dependency, import it, and then instantiate the Share class with the named constructor file like so: Share.file(path: , mimeType: ShareType, title: , text: ); where mimeType, title and text are optional, and then call share on it.

    It is fully functional for Android, the IOS part is currently being developed to match the Android part (only having plainText share at the moment).

提交回复
热议问题