rish_hyun
rish_hyun

Reputation: 481

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

Upvotes: 7

Views: 10751

Answers (1)

dm_tr
dm_tr

Reputation: 4753

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.

Upvotes: 8

Related Questions