Error when using Query and CollectionReference
When using the example in the documentation:
var queryRef = _firestore.collection('locations').where('city', isEqualTo: 'bangalore');
var stream = geo
.collection(collectionRef: queryRef)
.within(center: center, radius: rad, field: 'position');
I get this error: The argument type 'Query<Object?>' can't be assigned to the parameter type 'CollectionReference<Object?>'.dartargument_type_not_assignable.
I tried to downgrade but nothing worked.
I've the same problem and I don't know why. Before It worked perfectly but I did an update and it's broken. I hope some people had this and can resolved it.
Edit : I downgraded Cloud_firestore to 2.5.4 and GeoFlutterFire to 3.0.1 and It works
I'm facing the same issue.
The downgrade worked for me. Hoping for a fix at some point though too.
After upgrading the version of cloud firestore (was 2.5.3), this started to happen for me as well
I also get the same error. I'm using Firestore collection with "where" query. Here is the error: type '_JsonQuery' is not a subtype of type 'CollectionReference<Object?>' in type cast
I Downgrade to cloud_firestore: ^2.3.0 and geoflutterfire: ^3.0.1, and now it´s working.
Off course we are going to be stuck on Firestore 2.5.4, and we are already on 3.1.10. I am not sure how we can tackle this fix.
Using the latest version (3.0.3) the error doens't happen anymore, the only adjustment that i needed to make is to explicitly give a type for the Query (Query<Map<String, dynamic>>).
I can confirm Daimioo's comment as correct. Great news thank you for letting us know.
Just updated and working as it should.
(I also noticed "distance" change to "kmDistance" in my method)