Skip to content
This repository was archived by the owner on May 13, 2023. It is now read-only.
This repository was archived by the owner on May 13, 2023. It is now read-only.

Add public download url of the asset in StorageResponse #25

@paurakhsharma

Description

@paurakhsharma

First of all, Thank you for this amazing project.

Feature request

  • Add an option to get the public download URL for the uploaded asset just like firebase storage.

Is your feature request related to a problem? Please describe.

  • Currently, when I upload the asset to my storage I need to save the relative path of the asset in the database and download the file when I need to show it in the Flutter app.
  • This is a problem especially when I need to show an image to a user as I cannot directly use it as a Network Image.

Describe the solution you'd like

  • Ability to get the public URL of the file (just like the one I can copy from the storage console) from the upload response.

Describe alternatives you've considered

Currently, I use a future builder to download the image and show it to the user.

Future<dynamic> downloadImage(String imagePath) {
    return _client.storage.from('journalImages').download(imagePath);
  }
FutureBuilder(
      future: downloadImage(imagePath),
      builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
        if (!snapshot.hasData)
          return Center(
            child: CircularProgressIndicator(),
          );

        return Image.memory(
          snapshot.data.data,
          height: height,
        );
      },
    )

Additional context

  • If this feature is lacking in the Supabase itself, I can move this issue to Supabase project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions