I have ListTile inside padding. I need to change the padding area color. How can I change it?
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) => Card(
elevation: 1,
color: MyColors.white,
margin: const EdgeInsets.symmetric(vertical: 0),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: ListTile(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
tileColor: Color(0xFFFCF9E8),
leading: Image(image: AssetImage(_allUsers[index]['icon']),height: 30,width: 30,),
title: Text(_allUsers[index]['name']),
subtitle: Text('${_allUsers[index]["generic"]}'),
trailing: Text('${_allUsers[index]["unit_price"]}'),
),
),
),
childCount: _allUsers.length,
),
),
2
Answers
Use
Container
instead ofPadding
and give padding and color to it like this:you can use
ColoredBox
for that: