'How to share an image from gallery with my flutter app?

Can anyone point me to a library or advice on how I can go about sharing an image from the gallery with my app using the share button? I want to have my app appear in the list of apps to share with. There are libraries such as [share] https://pub.dev/packages/share that allow you to share content from your app with other apps but it doesn't do what I am looking for.



Solution 1:[1]

TL:DR Coming from android,you can do this with a content provider. then using platfrom channels get it to flutter.

Allowing Other Apps to Start Your Activity

For example, if you build a social app that can share messages or photos with the user's friends, you should support the ACTION_SEND intent. Then, when users initiate a "share" action from another app, your app appears as an option in the chooser dialog (also known as the "disambiguation dialog")

To allow other apps to start your activity in this way, you need to add an element in your manifest file for the corresponding element.

When your app is installed on a device, the system identifies your intent filters and adds the information to an internal catalog of intents supported by all installed apps. When an app calls startActivity() or startActivityForResult(), with an implicit intent, the system finds which activity (or activities) can respond to the intent.

read more from docs

Solution 2:[2]

I guess you are searching for something like explained here:

https://medium.com/flutter-community/receive-sharing-files-to-flutter-app-from-another-app-7a84c0c0cd88

You could also try this flutter package: https://pub.dev/packages/receive_sharing_intent

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 griffins
Solution 2 progNewbie