I have successfully added a shadow to my Container using the Material Widget and BoxShadow. However, I am facing an issue with the shadow position when I expand a ListView at the bottom of the fixed container. As I scroll up vertically, the container shadow goes down behind the ListView items, which is not the desired behavior. I want the shadow to appear on top of the ListView items as I scroll vertically. Can someone please assist me with this?
Below is the snippet of my code:
Material(
elevation: 2,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.red,
blurRadius: 2,
spreadRadius: 2,
offset: Offset(0,2),
),
],
),
height: SizeConfig.isLargeScreen ? 60.h : 105.h,
width: double.infinity,
child: !SizeConfig.isLargeScreen),),
Note: I have also given elevation 3 to my ListView card. How can I make sure that the container shadow stays above the ListView while scrolling vertically? Any help would be greatly appreciated.