I am facing a challenge with my screen layout that uses GridView.builder
with crossAxisCount: 3
. In the itemBuilder
, I am returning a Container
with shadows on the left, right, and bottom, but so far, I have not been able to achieve the desired outcome.
And here is the result I am aiming for:
GridView.builder(
padding: EdgeInsets.symmetric(horizontal: 15),
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 15,
mainAxisSpacing: 20,
childAspectRatio: 2 / 3.3,
),
primary: false,
shrinkWrap: true,
itemCount: 100,
itemBuilder: (context, index) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 5,
spreadRadius: 5,
offset: Offset(1, 1)),
]),
);
},
),