How can I retrieve Firebase storage image in flutter without getting downloadUrl and display it within some image compatible widget. I don't want my users to anyhow see download url even if they open my code
Asked
Active
Viewed 622 times
1 Answers
2
If you're using the FlutterFire Storage library in your app, you can call getData
on a reference to the file to get its data. So with that you just need to know the path to the data, and you won't need the download URL in your application. Once you have the data locally, you can create an image out of it with: Converting a byte array to image in Flutter?
Unlike download URLs, the call to getData()
is checked by security rules, so you'll have to ensure that the user is permitted to access the file.

Frank van Puffelen
- 565,676
- 79
- 828
- 807
-
Does it consumes more bandwidth or data transfer then download url? – Noobdeveloper Aug 11 '21 at 17:33
-
1I don't think so, but if that is a concern for you, I'd recommend measuring it in your app. – Frank van Puffelen Aug 11 '21 at 18:20