'Customize leading, trailling, and add shadow on ListTile
How to make ListTile like this?

I try to make but I'm having trouble with the leading (Image) height, the trailing (rating), and the shadow. I know that the best way is to create a custom widget. But I feel using only ListTile it can be done.
My code:
Container(
margin: const EdgeInsets.symmetric(vertical: 8.0),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: const Color(0xFF7090B0).withOpacity(0.2),
blurRadius: 20.0,
offset: const Offset(0, 10.0),
)
],
),
child: ListTile(
tileColor: kWhiteColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(defaultBorderRadiusCircular),
),
contentPadding: const EdgeInsets.symmetric(horizontal: 8.0),
leading: Container(
width: 70.0,
height: 70.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(defaultBorderRadiusCircular),
image: const DecorationImage(
fit: BoxFit.cover,
image: AssetImage('assets/image_destination6.png'),
),
),
),
title: Text(
'Danau Beretan',
style: blackTextStyle.copyWith(
fontSize: 18.0,
fontWeight: medium,
),
),
subtitle: Text(
'Indonesia',
style: greyTextStyle.copyWith(
fontSize: 14.0,
fontWeight: light,
),
),
),
),
Solution 1:[1]
you use Card https://api.flutter.dev/flutter/material/Card-class.html.
Container(
margin: const EdgeInsets.symmetric(vertical: 8.0),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: const Color(0xFF7090B0).withOpacity(0.2),
blurRadius: 20.0,
offset: const Offset(0, 10.0),
)
],
),
child: Card(
color: Colors.white,
child: ListTile(
tileColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.5),
),
contentPadding: const EdgeInsets.symmetric(horizontal: 8.0),
leading: Container(
width: 70.0,
height: 70.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
image: const DecorationImage(
fit: BoxFit.cover,
image: NetworkImage('https://picsum.photos/250?image=9'),
),
),
),
title: Text(
'Danau Beretan',
style: blackTextStyle.copyWith(
fontSize: 18.0,
fontWeight: medium,
),
),
subtitle: Text(
'Indonesia',
style: greyTextStyle.copyWith(
fontSize: 14.0,
fontWeight: light,
),
),
)
),
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | sh.seo |

