0

I use the following code to save my image:

var result = await ImageGallerySaver.saveImage(
        pngBytes,
        quality: 100,
        name: name,
        isReturnImagePathOfIOS: true,
      );

print (result['filePath']) // Gives content:/media/external/images/media/47939

Then I want to use the share_plus to share that file:

await Share.shareFiles(
      [filePath],
    );

But I am getting the following error:

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(content:/media/external/images/media/47939: open failed: ENOENT (No such file or directory), null, null, null)

Damandroid
  • 756
  • 9
  • 31
  • Yes, I figured it is not correct, hence the question – Damandroid Feb 14 '22 at 09:58
  • https://stackoverflow.com/a/59808848/7706354 .check this link it may helpful .convert your result path to absolute path with this plugin .flutter_absolute_path.then share .then you need android read permission – lava Feb 14 '22 at 10:05
  • Thanks, @lava. But this package 'flutter_absolute_path' was published two years ago and might be outdated with null safety concerns. – Damandroid Feb 14 '22 at 15:54

0 Answers0