【发布时间】:2020-09-20 15:29:53
【问题描述】:
我目前正在将一些数据上传到 Firestore:
Map<String, dynamic> ads = {
'adTitle': widget.title,
'adPrice': widget.price,
'adCategory': widget.dropdownValue,
'adCondition': this.newCondtionVal,
'adDesc': widget.desc,
'user_id': uID,
///TODO upload the images.
};
crudObj
.addData(ads)
.then((value) => {
showInSnackBar("dataAdded"),
})
.catchError((e) {
print(e);
});
通过 Image_Picker 选择的图像,问题是如何使用上述方法将其上传到 firebase。
PS:我是 Flutter 和 Firebase 的新手。
【问题讨论】:
-
您几乎肯定不想将 Firestore 用于图像数据。 Firestore 文档的大小限制为 1MB,任何许多图像都可以轻松增长到大于该大小。云存储更适合图片。
标签: firebase flutter google-cloud-firestore