I have app that app display one image to the user. that image I was saved it in MySQL database as a link and image in folder into server. Now I try to make user can share that image to other apps like WhatsApp or Facebook from my app.
I use share_plus 3.0.5 packages to make that:
await Share.shareFiles([//////////////////here/////////////], text: 'Image Shared');
Get image by this code:
Future MakeShare() async {
var response = await http.get(
Uri.parse("https://*********/ImageMakeShare.php?ID=" + widget.IDS.toString()),
headers: {"Accept": "application/json"});
setState(() {
var convertDataToJson = json.decode(response.body);
dataImage = convertDataToJson['result'];
if (dataImage != null) {
imageMaine = dataImage[0]['image'];
}}); }
I try to make it like that
await Share.shareFiles([imageMaine ], text: 'Image Shared');
But I get error:
E/flutter (10763): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(https:/*******0ee2e.png (No such file or directory), null, null, null)
Now I need to know how can I make user can share that image to other apps.
Anyone can help me?