I spent the entire weekend tried to fix this issue.
I had a similar issue with #42 . I had a collection used other plugin to support geoquery, then I used this plugin but get no data from the firestore.
I use json_serializable 2.0.0 and json_annotation 2.0.0 to wrap your GeoFirePoint.data into a dart class
part 'geo-location.g.dart';
@JsonSerializable(nullable: true)
class GeoLocation {
GeoPoint geopoint;
String geohash;
GeoLocation();
GeoLocation.from(GeoPoint point, String hash) {
this.geopoint = point;
this.geohash = hash;
}
factory GeoLocation.fromJson(Map<String, dynamic> map) => _$GeoLocationFromJson(map);
Map<String, dynamic> toJson() => _$GeoLocationToJson(this);
}
/* geo-location.g.dart */
GeoLocation _$GeoLocationFromJson(Map<String, dynamic> json) {
return GeoLocation()
..geopoint = json['geopoint'] == null
? null
: json['geopoint'] as GeoPoint
..geohash = json['geohash'] as String;
}
Map<String, dynamic> _$GeoLocationToJson(GeoLocation instance) =>
<String, dynamic>{
'geopoint': instance.geopoint,
'geohash': instance.geohash
};
Then in my data class, I define a field GeoLocation geoLocation to store the the GeoFirePoint.data. However if I use the json serializer to transform my object into Json to store in the Firestore, the GeoFlutterFire can't retrieve it, but if I use the raw data such as firestore.collection.document.update({'geoLocation': geoFirePoint.data) then the within can return this document. I verified the document in Firestore console, there is no difference between those two. Is there anything I did wrong?
Sorry I can't paste the code here, I can't make it reproducible in quick.