How to fix cropped shadow in a Horizontal List View in Flutter?

Posted by Andre Scott | Updated on

If you want to fix cropped shadow in a Horizontal List View in Flutter Steps to fix the problem

1. Create several Container(as a card) with some width and with a BoxShadow of Radius 10.0. Lets call it Child Container.

2. Create a ListView with Horizontal scroll axis. Put Child Containers made above in this ListView.

3. Now wrap the ListView inside a new Container(Lets call it Parent Container) to give ListView a height. If you want your Child Containers to be of height 140.0, then make your Parent Container’s height 160.0, which includes radius of BoxShadow of 10.0 on top & bottom each(10.0+ 140.0 + 10.0).

4. Now give padding to your ListView of 10.0 on both top & bottom.

5. Problem Solved (Silly Me).

Sample Code here


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers