【发布时间】:2019-10-25 08:15:57
【问题描述】:
由于某种原因,这段代码(使用 GeoFlutterFire)返回了我 Firestore 数据库中每个 DocumentSnapshot 的副本:
Stream<List<DocumentSnapshot>> stream = await geo
.collection(collectionRef: firestore.collection(structuresCollection))
.within(center: center, radius: radius, field: field);
stream.listen((List<DocumentSnapshot> docList) async {
placeModel = await updateList(docList);
_placeFetcher.sink.add(placeModel);
print('Place model: ${placeModel}');
});
我试过调试,从这里开始复制,但这只是一个简单的查询,我不太明白它有什么问题
你可以看到长度是 14,应该是 7,每个快照都是重复的
【问题讨论】:
-
看起来地理正在更新,因为当您实时更新和添加时,流会获取新数据。
-
实际上可能是一些库问题,我发现如果半径大于某个值,它的行为就像这样
标签: flutter dart google-cloud-firestore geofire