首页 > 解决方案 > 从 Firestore 中的数组更新特定索引

问题描述

我想更新我的数组的特定索引,但我明白了

“ type '_InternalLinkedHashMap<String, dynamic>' 不是类型 'String' 的子类型”。

有谁知道我为什么会收到这个错误?

                 Checkbox(
                    value: widget.raffles[index]
                        ["${auth.currentUser.uid}" + "link"],
                    onChanged: (val) {
                      setState(() {
                        sneakers.doc(widget.doc).set(
                          {
                            widget.raffles[index]: [
                              {
                                "${auth.currentUser.uid}" + "link": true,
                              }
                            ]
                          },
                          SetOptions(merge: true),
                        );
                      });
                    },
                  ),

标签: arraysfirebaseflutterdartgoogle-cloud-firestore

解决方案


推荐阅读