Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // From a button tap
- onTap: () async {
- print('MapFilerSettings..FINAL...slected.... check _lat = ' + _lat.toString());
- GeoPoint areaGP = new GeoPoint(_lat, _lng);
- Area searchArea = new Area(areaGP, 50.0);
- getEvents(seachArea);...
- /// biild future or StreamBuilder...test ???
- Stream<List<EventData>> getEvents(area) {
- try {
- return getDataInArea(
- area: area,
- locationFieldNameInDB: 'geoPoint',
- mapper: (eventDoc) {
- print('mapFiterSettings.....getGeoPointsByRadius....data: '+eventDoc.data['email'].toString());
- // var event = _eventSerializer.fromMap(eventDoc.data);
- // // if you serializer does not pass types like GeoPoint through
- // // you have to add that fields manually. If using `jaguar_serializer`
- // // add @pass attribute to the GeoPoint field and you can omit this.
- // event.location = eventDoc.data['location'] as GeoPoint;
- // event.id = eventDoc.documentID;
- // return new EventData(event);
- },
- locationAccessor: (eventData) => eventData.event.location,
- distanceMapper: (eventData, distance) {
- eventData.distance = distance;
- return eventData;
- }, collection: null,
- // distanceAccessor: (eventData) => eventDatas.distance, collection: null,
- // clientSitefilters: (event) => event.startTime > DateTime.now(), collection: null // filer only future events
- );
- } on Exception catch (ex) {
- print(ex);
- }
- return null;
- }
Add Comment
Please, Sign In to add comment