我正在开发一个应用,其中需要显示所有使用// Template A
{{B param1=1 param2=2 param3=3 ....}}
// Template B
{{C param1=param1 param2=param2 param3=param3 ....}}
存储在Firebase中的讲师详细信息。我为此使用了list_view
。我在所有列表视图中都得到了相同的数据,这意味着所有图块都包含相同的讲师ID。
我尝试上传屏幕截图,但我无法上传
输出: 1:存在变量:
list_builder
2:变量key_id:
{LEC02: {EMAIL: , SEX: MALE, ADDRESS: , MOBILE: , ID: LEC02, NAME: VIGNESH, POSITION: LECTURER, PASSWORD: LEC02, PHOTO: , QUALIFICATION: BCOM, DOJ: 2018-12-24 00:00:00.000}, LEC04: {EMAIL: , SEX: MALE, ADDRESS: , MOBILE: , ID: LEC04, NAME: KARTHIK, POSITION: LECTURER, PASSWORD: LEC04, PHOTO: , QUALIFICATION: MCOM, DOJ: 2018-12-26 00:00:00.000}}
3:变量数据:
(LEC02, LEC04, LECTURER 01, LEC03, LEC01)
({EMAIL: , SEX: MALE, ADDRESS: , MOBILE: , ID: LEC02, NAME: VIGNESH, POSITION: LECTURER, PASSWORD: LEC02, PHOTO: , QUALIFICATION: BCOM, DOJ: 2018-12-24 00:00:00.000}, {EMAIL: , SEX: MALE, ADDRESS: , MOBILE: , ID: LEC04, NAME: KARTHIK, POSITION: LECTURER, PASSWORD: LEC04, PHOTO: , QUALIFICATION: MCOM, DOJ: 2018-12-26 00:00:00.000}, {EMAIL: , SEX: FEMALE, ADDRESS: , MOBILE: , ID: LECTURER 01, NAME: AA, POSITION: LECTURER, PASSWORD: LECTURER 01, PHOTO: , QUALIFICATION: KAAM, DOJ: 2018-12-25 00:00:00.000}, {EMAIL: , SEX: MALE, ADDRESS: , MOBILE: , ID: LEC03, NAME: PRANEETH, POSITION: HOD, PASSWORD: LEC03, PHOTO: , QUALIFICATION: MCA, DOJ: 2018-12-25 00:00:00.000}, {EMAIL: , SEX: MALE, ADDRESS: , MOBILE: , ID: LEC01, NAME: NISHA, POSITION: LECTURER, PASSWORD: LEC01, PHOTO: , QUALIFICATION: MCOM, DOJ: 2018-12-26 00:00:00.000})
答案 0 :(得分:0)
您应该使用StreamBuilder并从数据库中提供快照作为流,并在构建器中返回listview。这使您的列表视图保持刷新,因此您的用户将始终具有更新的数据。