【发布时间】:2021-02-26 07:11:55
【问题描述】:
代码:
void func({String value}) async {
final QuerySnapshot snapshot = await _firestore
.collection('users')
.where("id", isEqualTo: signedInUser.id)
.get();
snapshot.docs.forEach((element) {
List<dynamic> arr = element.data()["array"];
print(arr);
}
}
输出:
I/flutter (27759): [10, 20, 30, 33, 34, 24]
I/flutter (27759): [2, 42, 45, 23, 85, 51]
I/flutter (27759): [32, 53, 12, 67, 34, 23]
这是我从 Firebase 文档打印列表时得到的结果。
如何为每个索引添加数组项?喜欢;索引 0 为 10 + 2 + 32
【问题讨论】:
-
我无法理解您的问题?你能举个例子说明你想要的结果吗?
-
我已经更新了问题。现在清楚了吗?
标签: arrays list dart indexing add