gpt4 book ai didi

Flutter 聚合/将新项目添加到 PopupMenuButton 中的项目列表

转载 作者:行者123 更新时间:2023-12-04 13:24:15 25 4
gpt4 key购买 nike

我正在使用 PopupMenuButton在我的聊天应用程序中。我想通过点击更多选项项目(与 Whatsapp 相同)来更改我的项目列表。
似乎 Whatsapp 刚刚关闭了 PopupMenuButton小部件并打开一个新的。
enter image description here
enter image description here
如何关闭当前PopupMenuButton并在点击项目时打开一个新项目?

最佳答案

试试下面的代码希望它对你有帮助。我想你用过 膨胀瓦用于您设计的小部件请参阅文档 here
你的小部件:

   showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Choose Option',
),
content: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
title: Text('Your Text'),
),
ListTile(
title: Text('Your Text'),
),
ListTile(
title: Text('Your Text'),
),
ExpansionTile(
title: Text('ExpansionTile'),
children: <Widget>[
ListTile(
title: Text('This is tile number 1'),
),
ListTile(
title: Text('This is tile number 2'),
),
ListTile(
title: Text('This is tile number 3'),
),
ListTile(
title: Text('This is tile number 4'),
),
ListTile(
title: Text('This is tile number 5'),
),
],
),
],
),
),
);
},
);
您的结果屏幕 简单内容 -> enter image description here
您的结果屏幕当您单击扩展磁贴时 -> enter image description here

关于Flutter 聚合/将新项目添加到 PopupMenuButton 中的项目列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69567313/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com