首页 > 解决方案 > 我如何计算来自firestore的文档数量并以文本形式返回

问题描述

我想计算一个集合中有多少文档,

child: Card(
                      child: ListTile(

                          title: FlatButton.icon(
                              onPressed: null,

                              icon: Icon(Icons.people_outline),
                              label: Text("Users")),
                          subtitle: Text( Firestore.instance.collection('users').snapshots().length.toString() , textAlign: TextAlign.center, style: TextStyle(color: active, fontSize: 12.0),)),
                    ),

标签: androidfluttergoogle-cloud-firestorecollectionsdocument

解决方案


推荐阅读