我正试图通过从firebase获取图像来做旋转木马视图。我能够在listView中获得图像,并能够成功地将它们放置在卡片中,但不幸的是,我无法滚动列表视图。
return Container(
width: double.infinity,
height: 300,
child: ListView(
scrollDirection: Axis.horizontal,
children: snapshot.data!.docs.map((DocumentSnapshot document) {
Map<String, dynamic> data = document.data()! as Map<String, dynamic>;
return Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Stack(
children: [
SizedBox(
height: 200,
child: Card(
elevation: 10,
child: ClipRRect(
borderRadius: BorderRadius.circular(4),
child: Image.network(data['image'],width: 400,fit: BoxFit.fill,)),
),
),
],
),
),
);
}).toList(),
),
);
帮忙吗?
容器>SingleChildScroolView祝辞ListView尝试