Rodiii / flutter_firebase_picture_uploader

Picture upload widget for Flutter which helps selecting and uploading one or multiple images to firebase storage.
https://pub.dev/packages/firebase_picture_uploader
MIT License
13 stars 17 forks source link

How to retrieve the firebase url of files after upload ? #18

Open aasmoth opened 2 years ago

aasmoth commented 2 years ago

Hi there,

I found a way to get the name and fullpath of uploaded files, but I'm still searching for retrieving the url of those files.

How can I get the getDownloadURL() value ?

Thanks a lot

heloise-viegas commented 2 years ago

Hi, Are you using something like this ?

`Future downloadURLExample() async { String downloadURL = await firebase_storage.FirebaseStorage.instance .ref('users/123/avatar.jpg') .getDownloadURL();

// Within your widgets: // Image.network(downloadURL); }`

https://firebase.flutter.dev/docs/storage/usage/

aasmoth commented 2 years ago

Hi, Thank you. I did it like that and it should work but, as it's impossible here to use the await typecasting,, it doesn't.

I can't use UploadTask uploadTask = storageReference.putFile(FileImage); to get url like this downloadURL = await (await uploadTask).ref.getDownloadURL();

So, I get the error Error getting App Check token; using placeholder token instead. Error: com.google.firebase.Firebase and I have to use this GRRRR Appcheck and his very very poor flutter documentation. Actually, I don't know how to implement this and I stuck with this :)

heloise-viegas commented 2 years ago

Hey, Sorry that didn't help you. I'm actually a beginner in both Flutter and Open source. I was just hoping to find something to contribute to .