【问题标题】:Exception: type '_AsBroadcastStream<List<DocumentSnapshot<Object?>>>' is not a subtype of 'Stream<List<DocumentSnapshot<Map<String, dynamic>>>>例外:类型 '_AsBroadcastStream<List<DocumentSnapshot<Object?>>>' 不是 'Stream<List<DocumentSnapshot<Map<String, dynamic>>>> 的子类型
【发布时间】:2021-12-11 20:07:14
【问题描述】:

完整的 Android Studio Logcat 投诉:

Dart 未处理的异常:类型 '_AsBroadcastStream>>' 不是子类型 'Stream>>>' 类型的

我正在使用GeoFlutterFire2 插件,它致力于在 Geohash 上查询 Firebase。好了没有了!我尝试将pubspec.yaml 更新为更新的cloud_firestore:^3.1.4 似乎已经沉淀了这一点,所以我将 cloud_firestore 滚回 ^2.5.4

      setUpJobStream(double _distanceFromUser) {
        localJobsStream = geo
            .collection(
            collectionRef: myFirestore
                .collection('GB/Edinburgh/JobsDetailed'))
            .within(
            center: usersAddressGeoFirePoint,
            radius: _distanceFromUser,
            field: 'position',
            strictMode: true);
    
        localJobsStream.listen((List<DocumentSnapshot<Map<String,dynamic>>> documentList) {
          if(documentList.isNotEmpty) {

... 我尝试了显而易见的事情,只需将 localJobsStream.listen 参数切换为: localJobsStream.listen((List&lt;DocumentSnapshot&lt;Object?&gt;&gt; documentList) { 但它没有用:/

这真的很令人沮丧。感觉我应该是这个的老板,感谢帮助。

【问题讨论】:

    标签: flutter google-cloud-firestore geohashing


    【解决方案1】:

    返回的类型已更改。 IT 现在返回 Object? 而不是 Map 我在使用流转换器时遇到了同样的问题。

    List>> 替换为 List>

    【讨论】:

      猜你喜欢
      • 2021-05-10
      • 2021-12-29
      • 2023-01-08
      • 2021-11-11
      • 1970-01-01
      • 1970-01-01
      • 2021-10-25
      • 2020-07-03
      • 2019-12-05
      相关资源
      最近更新 更多