i am new to flutter and i am trying to make this screen:
What i have now is :
i tried everything to make the image look like the example but no success, played with containers height, AspectRatio. also i dont understand how to have empty space betwwen the price and zipcode like the example.
Hope someone can help me out. thanks all
My code:
body: ListView.builder(
itemCount: houses.length,
itemBuilder: (context,index){
final hous = houses[index];
String baseurl = '';
return Container(
color: const Color(0xFFEBEBEB),
height: 130.0,
child: Padding(
padding: const EdgeInsets.only(left:10.0,top:5.0,right:10.0,bottom: 5.0),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0)
),
color: Colors.white,
child: Container(
// height: 120.0,
child: ListTile(
// contentPadding: EdgeInsets.zero,
leading: Container(
width: 120,
height: 1220,
child: ClipRRect(
borderRadius: BorderRadius.circular(10.0),
child: Container(
// height: double.infinity, // Set the height to fill the available space
child: Image.network(
Uri.parse(baseurl).resolve(hous['image']).toString(),
fit: BoxFit.cover,
alignment: Alignment.centerLeft,
),
),
),
),
title: Row(
children: [
const Text('$'),
Text(hous['price'].toString()),
],
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
const SizedBox(height: 20),
Text(hous['zip']),
Text(hous['city']),SizedBox(height: 8,)
],
),
Row(
children: [
SvgPicture.asset('assets/icons/ic_bed.svg',),
Text(hous['bedrooms'].toString()),
SizedBox(width: 10),//width for space betweens icons
SvgPicture.asset('assets/icons/ic_bath.svg'),
Text(hous['bathrooms'].toString()),
SizedBox(width: 10),
SvgPicture.asset('assets/icons/ic_layers.svg'),
Text(hous['size'].toString()),
SizedBox(width: 10),//
SvgPicture.asset('assets/icons/ic_location.svg'),
Text('km'),
],
)
],
),
),
),
),
),
);
})
2
Answers
Card Design using Row and Column:
You can use this widget for your images. Just change the image source and you can use it.