可折叠的控件

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'))
      ]),
    );
  }
}

 

ExpansionTile(每日Flutter 小部件)

 

 

 

相关文章:

  • 2021-07-20
  • 2022-12-23
  • 2021-12-19
  • 2021-05-15
  • 2022-12-23
  • 2022-01-01
  • 2021-05-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案