Flutter:在流中从Firestore撤回文档

时间:2018-11-23 17:05:13

标签: android stream flutter google-cloud-firestore

我想从邮件集中检索文档;但我没有得到结果,而且我也没有从颤动中出错。这是我的代码

      body:  new Center(
    child: new StreamBuilder(
        stream:  Firestore.instance.collection("messages").snapshots(),
        builder: (context, snapshot){
          if(!snapshot.hasData) return const Text("Chargement ...");
          return ListView.builder(
            itemCount: snapshot.data.documents.length,
            itemBuilder: (context, index)=> new Text("papa"),
          );

        }
    ),
  )

这是我的Firebase数据库 firebase

1 个答案:

答案 0 :(得分:0)

使用new Text(document['papa'])

检查文档:https://pub.dartlang.org/packages/cloud_firestore