dynamic imageList = selectedImage.map((file) {
return file['image']; // selected image has image key
}).toList();
imageList.forEach((f) async {
final StorageReference _ref = FirebaseStorage.instance
.ref().child('prescription/${nameController.text}/${basename(f.path)}');
final StorageUploadTask uploadTask = _ref.putFile(f);
await(await uploadTask.onComplete)
.ref
.getDownloadURL()
.then((onValue) {
setState(() {
uploadedFileUrl.add({'url' : onValue});
});
});
我得到了URL,但是我想将它们存储在数组中,以便可以将它们保存到我的Firestore数据库中。 我正在尝试从Firebase存储中获取来自特定文件夹的一系列图像的下载URL