簡體   English   中英

Flutter Firestore 數據返回 null

[英]Flutter firestore data returning null

我有一份申請。 在此,我正在查詢位置數據。 下面是我的代碼和 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);
    });

在此處輸入圖片說明

當我使用http://geohash.co/解碼 geohash abc66ghh時,它顯示位置 49.63150978、170.63432693,這是白令海的一個位置。

當我使用https://www.movable-type.co.uk/scripts/geohash.html編碼緯度:28.535517,經度:77.391029 時,它顯示了 geohash ttp43和印度北部的一個位置。

地圖顯示提到的那些地方

我不確定您要搜索的范圍是什么,但這些地方似乎不太可能足夠接近以匹配它。 鑒於您共享的屏幕截圖中的position字段,geohash 的編碼似乎出了點問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM