1.Please, can someone tell me how to create a row of text boxes that are scrollable to left or right in flutter inside a ListView. I can see that I am trying to define an in
You can use:
@override
Widget build(BuildContext context) {
return Column(
children: [
SizedBox( // Horizontal ListView
height: 100,
child: ListView.builder(
itemCount: 20,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return Container(
width: 100,
alignment: Alignment.center,
color: Colors.blue[(index % 9) * 100],
child: Text(index.toString()),
);
},
),
),
SizedBox( // Vertical ListView
height: 200,
child: ListView.builder(
itemCount: 20,
itemBuilder: (context, index) {
return Container(
width: 50,
height: 50,
alignment: Alignment.center,
color: Colors.orange[(index % 9) * 100],
child: Text(index.toString()),
);
},
),
),
],
);
}
Note: For simplicity I didn't refactor the two ListView
in a single Widget