i'm trying to display only 1 card widget inside a listView.builder, the card is displayed but shows extra space that I couldn't find a way to remove.
There are actually 2 separated listViews, one should contain a single card and another that holds a list of cards.
here's my code:
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
'Fiche du patient',
style: TextStyle(color: Colors.black),
)),
body: Column(
children: <Widget>[
Expanded(
child: ListView.builder(
itemCount: 1,
itemBuilder: (BuildContext context, int index) {
return Card(
color: Colors.white,
elevation: 2.0,
margin: EdgeInsets.all(10),
child: ListTile(
contentPadding: EdgeInsets.only(right: 30, left: 36),
title: Text('${widget.patient['nomComplet']}'),
subtitle: Text('Médecin: ${widget.patient['medecin']}'),
trailing: Text('CH: 107'),
leading: Icon(Icons.person),
),
);
}),
),
Expanded(
child: ListView.builder(
itemCount: docsMesures.length,
itemBuilder: (BuildContext context, int index) {
return Card(
margin: EdgeInsets.all(10),
child: ListTile(
trailing: IconButton(
icon: Icon(Icons.edit),
onPressed: () {
Fluttertoast.showToast(
msg: 'Traitement de la demande');
},
),
contentPadding: EdgeInsets.only(right: 30, left: 36),
title: Text(
'Demandée par: ${docsMesures[index]['affectePar']}'),
subtitle: Text(
'Date limite: ${DateFormat('dd-MM-yyyy hh:mm a').format(docsMesures[index]['datePrise'].toDate())}'),
));
},
),
)
],
),
);
}
}
And here is the result as displayed:
Thanks in advance!

