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
Try this.
body : Container(
constraints: BoxConstraints.expand(),
padding: const EdgeInsets.all(10.0),
child : ListView.builder(
itemCount : providerApp.domains.length + 1,
itemBuilder : (BuildContext context, int index){
Widget result;
if(index == 0){
result = Text("Header");
}else{
result = Container(..Your list item code here.);
}
return result;
},
),
)
PS: If you want add widget to bottom of list, condition is provider.domain.length + 1
.
I hope to help you.