Based on this design:
I am trying to use SliverList
with SliverAppBar
but I can't seem to overlap the items so when the top left and top right radius are applied the color of the previous item is present.
It's similar to this other post: How to overlap SliverList on a SliverAppBar
But I'm trying to apply the Stack
to all SliverList
children. The best I accomplished so far is a workaround where I wrap the item in another Container
and apply the previous background color:
CustomScrollView(
slivers: <Widget>[
SliverAppBar(
title: Text('Test'),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return Container(
child: Container(
child: Column(
children: <Widget>[
Container(
child: Text(
'Index is $index'.toUpperCase(),
),
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(bottom: 10.0),
),
Container(height: 200.0)
],
),
constraints: BoxConstraints.tightForFinite(width: 200),
decoration: BoxDecoration(
color:
index % 2 == 0 ? Color(0XFF45766E) : Color(0XFFECB141),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(40.0),
topRight: Radius.circular(40.0),
),
),
padding: EdgeInsets.only(
left: 20.0,
top: 10.0,
),
),
decoration: BoxDecoration(
color: index % 2 == 0 ? Color(0XFFECB141) : Color(0XFF45766E),
),
);
},
),
),
],
);
Thank you!