ListTile with shape is not hidden on scroll

58 Views Asked by At

I have a ListView.separated with ListTiles which contains a shape: RoundedRectangleBorder.

Everything is displayed as I want. But when I scroll the ListView, the content within the ListTile is hidden but not the shape. The ListView is in the Expanded as follow:

SafeArea

-- Padding

---- Column

------ Center

------ Expanded

Any help will be appreciated

2

There are 2 best solutions below

0
On BEST ANSWER

Try wrapping the ListView in a Material. The shape is drawn on the underlying material. By giving it its own material it shouldn't be able to draw outside its bounds

0
On

you can delete Expanded and add the listview in container and set height to container