I'm trying to use ListTileStyle after ListView
ListView(
ListTileStyle(),
Children:<widget>[
ListTile(),
ListTile(),
ListTile(),
]
),
but not able to use any property of ListTile. Can any one explain how ListTileStyle works.
Unfortunately, ListTile doesn't have background-color property. Hence, we have to simply wrap the ListTile widget into a Container/Card widget and then we can use its color property. Further, We have to provide SizedBox widget with some height to separate the same colored ListTiles. I hope it will definitely help you.
You should use "ListTileTheme" instead with your ListView as a child, so you can change any property of all the ListTiles you're going to use as childs.
ListTileTheme(
//properties you want to add
child: ListView(
children: <Widget>[//your code],
),
),
ListView(
Children:<widget>[
ListTile(),
ListTile(),
ListTileTheme(
//do sth.
child: ListTile(
),
)
]
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With