首页 > 解决方案 > 快照适用于 Documents[index] 但不适用于 Document(ID)

问题描述

我想访问基于文档 ID 而不是文档索引的流生成器​​。请帮忙。

        StreamBuilder(
            stream: Firestore.instance.collection('users').snapshots(),
            builder: (context, snapshot){

              if(!snapshot.hasData) return Text('Loading data.....');
              return
                  Center(child: Text(snapshot.data.documents[0]["Name"]),);

标签: fluttersnapshotstream-builder

解决方案


推荐阅读