Flutter如何在导航抽屉中添加可扩展菜单项?
问题内容:
我想将可扩展菜单添加到drawer颤动项。我如何才能
在颤振中实现此功能。
如果有任何示例或博客,请直接指出正确的方向。
问题答案:
您必须将抽屉子属性传递给ListView,然后在该ListView中使用ExpansionTile。看起来像这样:
Drawer(
child: ListView(
children: <Widget>[
ExpansionTile(
title: Text("Expansion Title"),
children: <Widget>[Text("children 1"), Text("children 2")],
)
],
),
);