im new in flutter , and im trying to create a listView Like this photo in my app:
this is my code :
return Scaffold(
body: Container(
child: Column(
children: <Widget>[
Align(
alignment: Alignment.topRight,
child: Container(
child: const Text(
':الآن',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(
height: 4,
),
Align(
alignment: Alignment.center,
child: Card(
semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
elevation: 5,
margin: const EdgeInsets.all(8),
child: Image.asset(
'assets/aire.jpeg',
fit: BoxFit.fill,
),
)),
const SizedBox(
height: 4,
),
Align(
alignment: Alignment.topRight,
child: Container(
child: const Text(
':آخر الأخبـار',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
);
My probleme is when i use the ListView.builder , Or ListTitle , all the views in the top disappear. how can i solve it , Thanks
CodePudding user response:
Wrap your ListView
with Expanded
to get available height inside column.
body: Container(
child: Column(
children: <Widget>[
.....
Expanded(
child: ListView( ...