类型'MethodChannelFieldValue'不是'FieldValuePlatform'类型的子类型Firebase

时间:2020-03-03 12:46:47

标签: firebase flutter

每当尝试附加Firebase数组时,我都会收到此错误type 'MethodChannelFieldValue' is not a subtype of type 'FieldValuePlatform'

我的代码:

          DocumentReference reportRef = _store.collection('games').document(pinNum.text);

          reportRef.setData({

            'players': FieldValue.arrayUnion(['hi']),

          }, merge:true);

1 个答案:

答案 0 :(得分:2)

尝试在pubspec.yaml firebase核心中更新为 firebase_core: ^0.4.4+2cloud_firestore: ^0.13.4。基本上是最新版本。