I have a list tile and it initially looks like this:
What I want is that when I click on it, it expands and show more information like below:
So is there any widget for this or do I have to do it manually?
CodePudding user response:
Yea You can achieve this by using package Expandable widget Try this you will get your requirement.
CodePudding user response:
just use ExpansionTile
which natively supported by flutter, official documentation.
CodePudding user response:
1.Expanded Group is something can help you easily
https://pub.dev/packages/expandable_group
2.Use expansion Tile
ExpansionTile(
title: Text('ExpansionTile 1'),
subtitle: Text('Trailing expansion arrow icon'),
children: <Widget>[
ListTile(title: Text('This is tile number 1')),
],
),
3.Create ListView with Divider
ListView.separated(
itemCount: count,
itemBuilder: (context, index) {
return ListTile(
title: Text('$index Title'),
);
},
separatorBuilder: (context, index) {
return Column(children:[]);
},
)