1

I tried using the https://pub.dartlang.org/packages/share plugin to share an image on my flutter app to other app like Whatsapp, Facebook and so on. But rather it sending the file name of the image(images/female/ankara/ank5.jpg) in my android project to the other application rather than the actually image.

How can make it send the actual image.

            Hero(
              tag: widget.imageList,
                child: PhotoView(
                  imageProvider: AssetImage(widget.imageList),
                )
              );


 final RenderBox box = context.findRenderObject();
                        Share.share(widget.imageList,
                            sharePositionOrigin:
                            box.localToGlobal(Offset.zero) &
                            box.size);

I excepted to send the actual image to the other app rather it in a string format.

Miguel Ruivo
  • 16,035
  • 7
  • 57
  • 87
  • 2
    Possible duplicate of [How do I share an image on iOS and Android using Flutter?](https://stackoverflow.com/questions/44181343/how-do-i-share-an-image-on-ios-and-android-using-flutter) – Miguel Ruivo Feb 07 '19 at 01:38
  • Have tried it, but it only sharing a particular image, I want to share different image as i click on it. – Salimonu Ayodele Feb 07 '19 at 12:26

1 Answers1

-1

As mentioned in the previous comment, you can follow the answer on this Stack Overflow post for sharing images from a Flutter app. As for selecting a different image, you can use storage path provider plugins like ext_storage or image_picker.

Omatt
  • 8,564
  • 2
  • 42
  • 144