I am trying to render a listview and divider in a column and have used a container to restrict the height.The text of the List Tiles is shown only within the Container however the listtile colour is shown outside the container. I want this layout but for the colour to be only shown within the container as well.
Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(10),
),
height: MediaQuery.of(context).size.height * 0.5,
width: MediaQuery.of(context).size.width * 0.8,
child: ListView.builder(
itemCount: 20,
itemBuilder: (ctx, index) => Column(
children: [
ListTile(
tileColor: Colors.red,
leading: Text("Test"),
),
Divider()
],
),
),
)
