You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying documents from GeoFlutterFire it returns the following error
`I/flutter (20321): Cloud call error!
I/flutter (20321): Code: internal
I/flutter (20321): Details: null
I/flutter (20321): Message: INTERNAL`
I'm querying it through the following method StreamBuilder<List<PetAdsRecord>>( stream: queryLocationPetAdsRecord( location: currentUserLocationValue, queryBuilder: (petAdsRecord) => petAdsRecord .where( 'ad_status', isEqualTo: 'Active', ) .orderBy('create_date', descending: true), limit: 15, ), builder: (context, snapshot){ ......
then Stream<List<PetAdsRecord>> queryLocationPetAdsRecord( {Query Function(Query)? queryBuilder, int limit = -1, bool singleRecord = false, LatLng? location}) => queryLocationCollection( location!, PetAdsRecord.collection, PetAdsRecord.serializer, queryBuilder: queryBuilder, limit: limit, singleRecord: singleRecord, );
here I use GeoFlutterFire to get snapshot of the documents Stream<List<T>> queryLocationCollection<T>( LatLng location, Query collection, Serializer<T> serializer, {Query Function(Query)? queryBuilder, int limit = -1, bool singleRecord = false}) { final builder = queryBuilder ?? (q) => q; var query = builder(collection); if (limit > 0 || singleRecord) { query = query.limit(singleRecord ? 1 : limit); } return geo .collection(collectionRef: query as Query<Map<String, dynamic>>) .within( center: GeoFirePoint( location.latitude, location.longitude, ), radius: FFAppState().userAdRadius.toDouble(), field: "location", ) .handleError((err) { print('Error querying $collection: $err'); }).map((s) => s .map( (d) => safeGet( () => serializers.deserializeWith(serializer, serializedData(d)), (e) => print('Error serializing doc ${d.reference.path}:\n$e'), ), ) .where((d) => d != null) .map((d) => d!) .toList()); }
I've added the index on my firestore and checked the structure of all documents and it is correct. if you can help me point out the issue or error in my code do let me know. Thanks!
The text was updated successfully, but these errors were encountered:
When querying documents from GeoFlutterFire it returns the following error
`I/flutter (20321): Cloud call error!
I/flutter (20321): Code: internal
I/flutter (20321): Details: null
I/flutter (20321): Message: INTERNAL`
I'm querying it through the following method
StreamBuilder<List<PetAdsRecord>>( stream: queryLocationPetAdsRecord( location: currentUserLocationValue, queryBuilder: (petAdsRecord) => petAdsRecord .where( 'ad_status', isEqualTo: 'Active', ) .orderBy('create_date', descending: true), limit: 15, ), builder: (context, snapshot){ ......
then
Stream<List<PetAdsRecord>> queryLocationPetAdsRecord( {Query Function(Query)? queryBuilder, int limit = -1, bool singleRecord = false, LatLng? location}) => queryLocationCollection( location!, PetAdsRecord.collection, PetAdsRecord.serializer, queryBuilder: queryBuilder, limit: limit, singleRecord: singleRecord, );
here I use GeoFlutterFire to get snapshot of the documents
Stream<List<T>> queryLocationCollection<T>( LatLng location, Query collection, Serializer<T> serializer, {Query Function(Query)? queryBuilder, int limit = -1, bool singleRecord = false}) { final builder = queryBuilder ?? (q) => q; var query = builder(collection); if (limit > 0 || singleRecord) { query = query.limit(singleRecord ? 1 : limit); } return geo .collection(collectionRef: query as Query<Map<String, dynamic>>) .within( center: GeoFirePoint( location.latitude, location.longitude, ), radius: FFAppState().userAdRadius.toDouble(), field: "location", ) .handleError((err) { print('Error querying $collection: $err'); }).map((s) => s .map( (d) => safeGet( () => serializers.deserializeWith(serializer, serializedData(d)), (e) => print('Error serializing doc ${d.reference.path}:\n$e'), ), ) .where((d) => d != null) .map((d) => d!) .toList()); }
I've added the index on my firestore and checked the structure of all documents and it is correct. if you can help me point out the issue or error in my code do let me know. Thanks!
The text was updated successfully, but these errors were encountered: