Reputation:
I'm trying to implement expansionTile with horizontal scrolling Listview not vertical . So in this below image I want make this enter image description here.
Upvotes: 1
Views: 2491
Reputation: 4402
Answer is to use scrollDirection: Axis.horizontal,
in your ListView
UPDATE
Column(
children: <Widget>[
Flexible(
child: ListView(
children: [
Container(
width: 100,
child: ListTile(
title: Text('No1'),
onTap: () {
setState(() {
selected = 0;
});
},
),
),
Container(
width: 100,
child: ListTile(
title: Text('No2'),
onTap: () {
setState(() {
selected = 1;
});
},
),
)
],
scrollDirection: Axis.horizontal,
),
),
Container(
height: 150,
color: selected == 0 ? Colors.red : Colors.green,
)
],
);
Upvotes: 1