How can I share images on a S3 bucket from a Flutter Web app?

Viewed 158

On the mobile versions of the app I am using the esys flutter share package

This is the snippet that I am using:

() async {
                    var request = await HttpClient()
                        .getUrl(Uri.parse(product.imageUrl));
                    var response = await request.close();
                    Uint8List bytes =
                        await consolidateHttpClientResponseBytes(response);
                    await Share.file(
                        'Text to show?', 'amlog.jpg', bytes, 'image/jpg',
                        text: '${product.name}\nSolo por $finalPrice');
                  }

Unfortunately this package doesn't support Web platform.

There is a package called share plus 2.0

On the example they say that one can share files in the following way:

Share.shareFiles(['${directory.path}/image.jpg'], text: 'Great picture');
Share.shareFiles(['${directory.path}/image1.jpg', '${directory.path}/image2.jpg']);

However, in my case the file is on S3. I need to download it to some app folder. Because my app is Web I don't know how to download the pictures and stored in a folder of the app. Is this possible? Is there another way to achieve what I want?

1 Answers

keep downloaded file in a variable and then push it where you need it.

Related