【发布时间】:2021-09-30 22:13:09
【问题描述】:
我在 listveiw.builder 小部件中显示了一个字符串列表,当我按下一个单词时,我想从 firebase 获取文档信息
var words = [red,blue,green,yellow] ;
我想根据列表的值获取文档
显示在:
ListView.builder(
itemCount: words.length,
itemBuilder: (context, index) {
return
Column(
children: [
Row(
children: [
Expanded(
flex: 3,
child: InkWell(
onTap: () {},
child: Text('${words[index]}'),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
// press this and get the data of {words[index]} document
},
child: Text(
'press to get color info',
),
),
),
],
),
Text( show the data here after fetching it from firestore)
],
);
},
)
【问题讨论】:
标签: firebase flutter dart google-cloud-firestore document