我想创建水平列表视图,下面是我的代码。但是什么也不显示,也没有收到任何错误,所以请告诉我这段代码中我的错误是什么
Container(
child: StreamBuilder(
stream: Firestore.instance.collection(EVENT_LIST).snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(themeColor),
),
);
} else {
return ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
itemBuilder: (context, index) => createListView(
context, snapshot.data.documents[index]),
itemCount: snapshot.data.documents.length,
);
}
},
),
),
下面是我的列表商品代码
Widget createListView(BuildContext context, DocumentSnapshot document) {
return ListTile(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
EventImages(document[EVENT_NAME], document[ID])));
},
title: new Text(
document[EVENT_NAME].toUpperCase(),
style: AppTheme.fontHeaderWhite14(context),
),
);
}