Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ListTile shape property [Flutter]

How ListTile shape parameter works in Flutter?

ListTile(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(10),
            side: BorderSide(color: Colors.black),
          ),
          title: Text('data'),
)

This piece of code not reflecting rounded border(not even any border)!
Any ideas how to make this happen and use shape property of ListTile
I have seen certain examples depicting ListTile as child for Card, Container, etc. and then it works
Then what does Shape do and how to use it in ListTile

like image 653
rish_hyun Avatar asked Aug 01 '26 03:08

rish_hyun


1 Answers

ListTile shape property is designed to round the InkWell effect. By applying borderRadius, you can only notice the ripple effect (splash color) limitation on your ListTile. The border side: BorderSide(//....) is not taken into account. If you anyway would like to have border on your ListTile, consider wrapping it in another widget, Container for instance, on which you'll use your border.

like image 89
dm_tr Avatar answered Aug 02 '26 17:08

dm_tr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!