Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using Query and CollectionReference #173

Open
bilalsammour opened this issue Jan 27, 2022 · 9 comments
Open

Error when using Query and CollectionReference #173

bilalsammour opened this issue Jan 27, 2022 · 9 comments

Comments

@bilalsammour
Copy link

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.

@Simats13
Copy link

Simats13 commented Feb 2, 2022

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

@pradeep-spikey-tech
Copy link

I'm facing the same issue.

@mellowcello77
Copy link

The downgrade worked for me. Hoping for a fix at some point though too.

@rafaelpbrasil
Copy link

After upgrading the version of cloud firestore (was 2.5.3), this started to happen for me as well

@ShohidulProgrammer
Copy link

ShohidulProgrammer commented Feb 20, 2022

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

@rimedar
Copy link

rimedar commented Mar 15, 2022

I Downgrade to cloud_firestore: ^2.3.0 and geoflutterfire: ^3.0.1, and now it´s working.

@mellowcello77
Copy link

mellowcello77 commented Mar 20, 2022

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.

@rafaelpbrasil
Copy link

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>>).

@mellowcello77
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants