Trying to add some widgets to before of a listview.... I searched and found to use expanded like:
return Scaffold(
appBar: AppBar(
title: Text(\'Test
You can achieve this by using listview inside list view, below is sample code please check
body: ListView(
children: [
Container(
height: 40,
color: Colors.deepOrange,
child: Center(
child: Text(
'Header',
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
),
ListView.builder(
physics: ScrollPhysics(),
shrinkWrap: true,
itemCount: 50,
itemBuilder: (BuildContext context, int index) {
return Container(
color: Colors.lime,
height: 60,
child: Center(
child: Text(
'Child $index',
style: TextStyle(color: Colors.black, fontSize: 16),
),
),
);
},
),
Container(
height: 40,
color: Colors.deepOrange,
child: Center(
child: Text(
'Footer',
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
),
],
),