Can i make listview.builder in listview.builder's onpressed?

  1. Summary of my problem
    I want to know about using listview.builder in listview.builder’s onpressed.
    For example, like this.

ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: snapshot.data!.length,
itemBuilder: (context, index) {
return Row(children: [
TextButton(
child: Text(snapshot.data![index].A),
onPressed: () {
ListView.builder(
scrollDirection: Axis.vertical,
itemCount:
snapshot.data![index].B.length,
itemBuilder: (context, index2) {
return Column(children: [
Text(snapshot
.data![index].C
.toString() +
snapshot
.data![index].B[index2]
.toString())
]);
});
},
)
]);
});

  1. What have I tried so far -
    I make code like upper code’s. And tried so many times to make button which create another listview.builder.
  2. Here’s the minimum code you would need to reproduce the problem -
    To format your code enter between 3 backticks like this

ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: snapshot.data!.length,
itemBuilder: (context, index) {
return Row(children: [
TextButton(
child: Text(snapshot.data![index].A),
onPressed: () {
ListView.builder(
scrollDirection: Axis.vertical,
itemCount:
snapshot.data![index].B.length,
itemBuilder: (context, index2) {
return Column(children: [
Text(snapshot
.data![index].C
.toString() +
snapshot
.data![index].B[index2]
.toString())
]);
});
},
)
]);
});

Try and wrap the inner ListView.builder into setState