【发布时间】:2020-11-26 13:57:38
【问题描述】:
我有一个 Firestore 数据库,其中有“Singer”,然后在每个歌手内部都有每个歌手的“Song List”子集合。我能够从主集合中获取数据,但不能从子集合中获取数据。你们能帮忙吗?
流生成器
StreamBuilder(
stream: Firestore.instance.collection('singers').snapshots(),
ListView.Builder
ListView.builder(
itemCount: snapshot.data.documents.length,
itemBuilder: (context, index) => SingleChildScrollView(
这是我想从子集合中显示数据的地方
Text(
snapshot.data.documents[index]['name'],
style: TextStyle(
fontSize: 20, color: Colors.red[500]),
)
【问题讨论】:
标签: firebase flutter dart google-cloud-firestore