The argument type 'Map Function()' can't be assigned to the parameter type 'Map'

后端 未结 4 1139
梦谈多话
梦谈多话 2021-01-05 03:02

This could initially was working but after firebase update, it is now giving me this error. I have added asterisks to the part giving the error. The error message has been

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-05 03:35

    Try the following:

      Record.fromSnapshot(DocumentSnapshot snapshot)
          : this.fromMap(snapshot.data(), reference: snapshot.reference);
    

    data() is a method:

      /// Contains all the data of this [DocumentSnapshot].
      Map data() {
        return _CodecUtility.replaceDelegatesWithValueInMap(
            _delegate.data(), _firestore);
      }
    

    that returns a Map

提交回复
热议问题