Closed momoDragon closed 5 years ago
I tried the example code and it worked. But how do i get other data from the query ?
Stream<List> getLocations({GeoPoint center, double radiusInKm}) { return getDataInArea( source: Firestore.instance.collection('items'), area: Area(center, radiusInKm), locationFieldNameInDB: 'position', mapper: (doc) => LocationSerializer().fromMap(doc.data), locationAccessor: (item) => item.position, // The distancemapper is applied after the mapper distanceMapper: (item, dist) { item.distance = dist; return item; }); }
What do i have to do?
I tried the example code and it worked. But how do i get other data from the query ?
Stream<List> getLocations({GeoPoint center, double radiusInKm}) {
return getDataInArea(
source: Firestore.instance.collection('items'),
area: Area(center, radiusInKm),
locationFieldNameInDB: 'position',
mapper: (doc) => LocationSerializer().fromMap(doc.data),
locationAccessor: (item) => item.position,
// The distancemapper is applied after the mapper
distanceMapper: (item, dist) {
item.distance = dist;
return item;
});
}
What do i have to do?