【发布时间】:2020-12-10 11:27:55
【问题描述】:
我将图像存储在 Firebase 存储和 Firestore 中的图像路径中,如何使用保存在 Firestore 中的路径获取该特定图像?
getImagePath() async {
var document = await firestoreInstance
.collection("products")
.document(widget.productId)
.get();
String path = document["filePath"];
setState(() {
filePath = path;
});
}
我是这样从 Firestore 获取文件名的,如何使用此文件名获取图像?
【问题讨论】:
-
文件路径是什么样的,你能评论一下吗?
-
"image_picker4011381564582645700.jpg" 像这样
-
当您将图像上传到 Firebase 时,您应该获取下载链接并存储它。
标签: firebase flutter dart google-cloud-firestore