【发布时间】:2021-08-31 02:13:55
【问题描述】:
我已经设置了一个 Textformfield,用户可以在其中填写他们的商店和 Geopoint 坐标。
然后他们按下提交按钮,它会在我们的 Firestore 集合中更新。
我遇到的问题是如何将其保存为 Geopoint 而不是字符串。
SizedBox(child: ElevatedButton(
onPressed: () async {
await collectionReference.add({
'shopName': _textEditingController.text,
'address': _textEditingController2.text,
'description': _textEditingController3.text,
'thumbNail': _textEditingController4.text,
'locationCoords':_textEditingController5.GeoPoint
},);
},
chil:Text('Add Data'),
))
【问题讨论】:
标签: firebase flutter google-maps google-cloud-firestore