Flutter Firestore数据返回空值

时间:2020-01-09 11:30:30

标签: firebase flutter google-cloud-firestore

我有一个申请。在此,我要查询位置数据。下面是我的代码和firebase结构。但是我得到的数据为空。如果我做错了任何事情,请告诉我。

GeoFirePoint center = geo.point(latitude: 28.535517, longitude: 77.391029);
    stream = radius.switchMap((rad) {
      var collectionReference = _firestore.collection('Salons');
      return geo.collection(collectionRef: collectionReference).within(
          center: center,
          radius: rad,
          field: 'position',
          strictMode: true);
    });

enter image description here

1 个答案:

答案 0 :(得分:0)

当我用http://geohash.co/解码geohash abc66ghh时,它显示的位置49.63150978,170.63432693,即白令海的位置。

当我使用https://www.movable-type.co.uk/scripts/geohash.html对纬度:28.535517,经度:77.391029进行编码时,它会显示geohash ttp43和印度北部的位置。

map showing the those places mentioned

我不确定您要搜索的范围是什么,但是这些地方似乎不太可能匹配它。给定您共享的屏幕快照中的position字段,看来geohash的编码出现了问题。