I have a problem with my flutter application. I want to upload an image to firebase storage and get the URL but the getDownloadUrl method doesn't work. Here is my code :
import 'package:firebase_storage/firebase_storage.dart' as firebase_storage;
...
Future<String> addImage(File file, firebase_storage.Reference reference) async{
firebase_storage.UploadTask task = reference.putFile(file);
firebase_storage.TaskSnapshot snapshot = task.snapshot;
String urlString = await snapshot.ref.getDownloadURL();
return urlString;
}
I think it's because of the new version of firebase_storage(5.2.0)