i am trying to upload image, and the same process is working for my other app, but here it gives these errors, can you guy plz help?
Future getImage1() async
You have to do the following:
FirebaseStorage storage = FirebaseStorage.instance;
Reference ref = storage.ref().child("image1" + DateTime.now().toString());
UploadTask uploadTask = ref.putFile(_image1);
uploadTask.then((res) {
res.ref.getDownloadURL();
});
StorageReference
class has been removed and now you have to use the class Reference. UploadTask extends Task
, which also implements Future
. Therefore all the methods that are in the class Future
can be used on the class UploadTask
.
So to get the url
of the image, you need to use the then()
method which registers a callback to be called when this future completes.