【发布时间】:2021-01-09 16:57:41
【问题描述】:
我试图将以下 Flutter Firebase 实时数据库代码更改为 Cloud Firestore,但出现此错误...
- 错误:没有为“查询”类型定义“子”方法。
- 错误:没有为“查询”类型定义“推送”方法。
DatabaseReference databaseReference = FirebaseDatabase.instance.reference().child('Products');
String uploadId = databaseReference.push().key;
HashMap map = new HashMap();
map['productName'] = productName;
map['productCat'] = selectedCat;
map['startingPrice'] = int.parse(startingPrice);
map['gapPrice'] = int.parse(gapPrice);
map['imageSrc'] = url;
map['timeStamp'] = DateTime.now().toString();
databaseReference.child(uploadId).set(map);
【问题讨论】:
标签: flutter firebase-realtime-database google-cloud-firestore