I have this code where am supposed to upload an image and get the downloaded url but whenever i do that I get this error
my url is String url;
. So please why is this not working as it is supposed to
PS I checked other website to learn how to properly upload but it keeps giving me an error or is there a better way to do this.
My code image
uploadTask.whenComplete(()async{
url = await refs.getDownLoadURL();
....
});
Since it returns a Future you need to wait for it to be accessed