I have a Simple screen with GridView.builder
with crossAxisCount: 3
, and in the itemBuilder
I am returning Container
with little shadow left, right, and bottom, but failed to achieve what I want.
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)),
]),
);
},
),
2
Answers
I believe I achieved what you are looking for based on the image you have provided by using a Card widget with elevation instead of a boxshadow. I also decreased the crossAxisSpacing a little to match the picture even more.
In your code you have given more blurradius and spread radius, just reduce it.Try this and adjust your blur and spread radius according to your view.