I correctly receive UploadTaskSnapshot
, and the field downloadUrl contains an instance of Uri
that parses download link of uploaded file.
H
From my this answer,
The latest version of plugin doesn't let you use task.future()
anymore and in the documentation they say to use lastSnapshot
which didn't work for me.
So, I used onComplete
. Here is the working solution:
StorageUploadTask uploadTask = storageRef.putFile(yourFile);
StorageTaskSnapshot storageTaskSnapshot = await uploadTask.onComplete;
String downloadUrl = await storageTaskSnapshot.ref.getDownloadURL();