我正在try 创建这个可滚动的堆叠列表:下面是图像. 想要的结果.
当我增加物品数量时,列出的物品会毁容,如果有人能帮助我,我将不胜感激. 增加itemCount时的结果
return Expanded(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
child: Container(
padding: P_ALL,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: Stack(children: [
...List.generate(10, (index) {
return Positioned(
top: index * 70.0,
left: 0,
right: 0,
height: 100.0,
child: Transform(
alignment: Alignment.center,
transform: Matrix4.identity()
..setEntry(3, 2, 0.0015)
..rotateX(.6),
child: InkWell(
onTap: () => print(index),
child: Container(
alignment: Alignment.topCenter,
width: MediaQuery.of(context).size.width,
height: 100.0,
decoration: BoxDecoration(
color: appRedColor,
boxShadow: [BoxShadow(spreadRadius: .2, blurRadius: 1.0, color: Colors.white)],
borderRadius: BorderRadius.circular(9.0),
image: DecorationImage(
image: NetworkImage(restaurantImages),
fit: BoxFit.cover,
)),
child: Padding(
padding: const EdgeInsets.only(top: 26.0),
child: Text('Fast Food',
style: customFont(
size: 20.0,
color: Colors.white,
weight: FontWeight.bold,
)),
),
),
),
),
);
}),
]),
),
),
),
],
),
);