gpt4 book ai didi

firebase - 从Firebase Firestore数据库集合中提取大量(大约300个)文档

转载 作者:行者123 更新时间:2023-12-03 04:57:08 25 4
gpt4 key购买 nike

我正在尝试从Firestore获取数据。该代码在FutureBuilder ListView中工作正常,我尝试将所有条目打印到控制台。下面的代码工作正常,但仅打印前10个左右的条目。

Future getP() async {
var firestore = Firestore.instance;
var q = await firestore.collection('place_list').getDocuments();
List<Map<String, dynamic>> list = q.documents.map((DocumentSnapshot doc) {
return doc.data;
}).toList();
print(list);
return q.documents;
}

The code :

The console output :

我想将所有300个条目打印在控制台中。有人可以帮我吗?

最佳答案

试试这个 debug打印而不是打印

debugPrint(list.toString(), wrapWidth: 1024);

或添加此方法,然后
void printWrapped(String text) {
final pattern = new RegExp('.{1,800}'); // 800 is the size of each chunk
pattern.allMatches(text).forEach((match) => print(match.group(0)));
}

call

printWrapped(list.toString());



检查 this以获取更多信息。

关于firebase - 从Firebase Firestore数据库集合中提取大量(大约300个)文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60411928/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com