ExpansionTile(每日Flutter 小部件)
可折叠的控件
initiallyExpanded: true, 初始是否展开
class ExpansionTileWidget extends StatelessWidget { @override Widget build(BuildContext context) { return getLv(context); } Widget getLv(BuildContext context) { return Expanded( child: ListView(children: <Widget>[ const ListTile(title: Text('Top')), ExpansionTile( title: const Text('Sublist'), backgroundColor: Theme.of(context).accentColor.withOpacity(0.025), initiallyExpanded: true, children: const <Widget>[ ListTile(title: Text('One')), ListTile(title: Text('Two')), ListTile(title: Text('Free')), ListTile(title: Text('Four')) ]), const ListTile(title: Text('Bottom')) ]), ); } }