问题
It is fairly straightforward hot to set basic types inside Firestore.
But I cannot find how to construct Geopoint, Timestamp and another document reference with flutter Firestore plugin.
What do you assing inside data that you set to the coollection Map<String,dynamic> for each object?
Any help or examples?
回答1:
I created manually an object on the server and got it inside my flutter app.
For TimeStamp you can pass DateTime object directly from dart.
For Geopoint there is GeoPoint object inside Firestore plugin.
new GeoPoint(longitude: 3.4, latitude: 4.5) })
For another document reference, you would pass DocumentReference that you retrieved as a value to the data object.
来源:https://stackoverflow.com/questions/50573854/how-to-add-geopoint-timestamp-and-reference-to-a-document-in-firestore-trough-f