DarshanGowda0 / GeoFlutterFire

:fire:GeoFlutterFire:fire: is an open-source library that allows you to store and query firestore documents based on their geographic location.
https://youtu.be/MYHVyl-juUk
MIT License
305 stars 261 forks source link

Unhandled Exception: type '_BroadcastStream<QuerySnapshot>' is not a subtype of type 'Future<QuerySnapshot>' #68

Closed ggutenberg closed 4 years ago

ggutenberg commented 4 years ago

I'm new to Flutter and this library, and am just trying to get the example working. I'm able to add points to Firestore, but when I try moving the slider I get:

E/flutter ( 6489): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type '_BroadcastStream<QuerySnapshot>' is not a subtype of type 'Future<QuerySnapshot>'
E/flutter ( 6489): #0      GeoFireCollectionRef._createStream 
package:geoflutterfire/src/collection.dart:150
E/flutter ( 6489): #1      new GeoFireCollectionRef 
package:geoflutterfire/src/collection.dart:14
E/flutter ( 6489): #2      Geoflutterfire.collection 
package:geoflutterfire/src/geoflutterfire.dart:10

I've also tried just adding this lib to an existing Flutter app, and wiring it up as per https://github.com/DarshanGowda0/GeoFlutterFire/issues/16 , and I get the exact same error. This leads me to believe something in a dependent library has changed since these examples were written.

pubspec.yaml versions:

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cloud_firestore: ^0.13.0+1
  firebase_messaging: 6.0.3
  geolocator: 5.1.5
  geoflutterfire: 2.0.3+7
  rxdart: 0.23.1
  google_maps_flutter: 0.5.7

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter
Krojce commented 4 years ago

https://github.com/DarshanGowda0/GeoFlutterFire/pull/69 should fix that.

You can use my fork, before the pull request is approved. geoflutterfire: git: url: https://github.com/Krojce/GeoFlutterFire.git

ggutenberg commented 4 years ago

69 has been merged and works in my testing. Closing this one.