Reputation: 19514
I want to show 2 custom widgets and listview(api data). I can't use column
.(Because I want to scroll one time)
In here, missing 0 and 1 data coming from api
ListView.builder(
itemCount: get.length,//3
itemBuilder: (BuildContext context, int index) {
if(index == 0){
return Text('Generate By Developer');
}
if(index == 1){
return Text('Generate By Developer');
}
return Bubble(
style: styleSomebody,
child: Container(
...
));
}),
Upvotes: 0
Views: 1592
Reputation: 51769
Just tweak the count and the index.
ListView.builder(
itemCount: get.length + 2, // add room for the two extra
itemBuilder: (BuildContext context, int index) {
if(index == 0){
return Text('Generate By Developer');
}
if(index == 1){
return Text('Generate By Developer');
}
index -= 2; // decrement index so that it's now in the range [0..length]
return Bubble(
style: styleSomebody,
child: Container(
...
));
}),
Upvotes: 1