具有条件的GeoFlutterFire

时间:2020-06-06 15:12:04

标签: firebase flutter google-cloud-firestore geofire

我正在使用GeoFlutterFire,并根据位置信息获得了理想的结果。

[编辑] 下面是数据库截图

enter image description here

但是,当我尝试添加 where 条件时,它永远不会返回任何结果。

var querySnapshot = Firestore.instance.collection('docCollection').where('userId', isEqualTo: 'XXXXXXXXnT7ZPXXXX7s') //Data returns if i remove where condition


Geoflutterfire geo = Geoflutterfire();
GeoFirePoint center = geo.point(latitude: 18.335203, longitude: 27.34272);

var stream = geo.collection(collectionRef: querySnapshot).within(
center: center,
radius: 10,
field: 'location');


stream.listen((onData) {
  print('in listen ${onData.length}'); 
});

0 个答案:

没有答案