我有Container
作为ScrollablePositionedList
项生成器的子级,并且Container
有一些装饰和阴影。但是,框阴影显示在其他列表项上方。
我尝试使用ListView
的生成器及其按预期方式工作,未在其他列表项上方显示框阴影。关于导致问题的原因有什么建议吗?
ScrollablePositionedList.builder(
itemCount: services.length,
itemBuilder: (context, index) {
var service = services[index];
return Container(
padding:
EdgeInsets.symmetric(horizontal: 30, vertical: 15),
margin: EdgeInsets.symmetric(horizontal: 20, vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(15)),
boxShadow: [
BoxShadow(
color: Color(0x1a000000),
blurRadius: 20,
spreadRadius: 0,
offset: Offset(0, 10))
]),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
SizedBox(
width: 200,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
service.name,
style: TextStyle(fontSize: 20),
),
Text(
service.description,
style: TextStyle(fontSize: 12),
overflow: TextOverflow.ellipsis,
maxLines: 2,
),
],
),
),
MaterialButton(
minWidth: 0,
child: Text('Edit'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddServiceDetails(
serviceEdit: _serviceChanged,
)));
},
shape: new RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10),
)),
clipBehavior: Clip.antiAlias,
textColor: Colors.teal,
)
],
),
);
}),