flutter - 如何在颤动中更改弹出背景颜色
问题描述
我已经在我的项目中创建了这个弹出菜单,我正在尝试更改弹出菜单的背景颜色,但我不确定如何更改它,所以如果我能得到任何帮助或建议,我将不胜感激。
? PopupMenuButton(
icon: Icon(
Icons.more_vert,
color: Colors.white,
),
onSelected: selectedOption,
itemBuilder: (BuildContext context) {
return Popup.choises.map((String value) {
return PopupMenuItem<String>(
value: value,
child: Text(value),
);
}).toList();
})
解决方案
Just provide the color parameter to PopupMenuButton and it will work.
///example
PopupMenuButton(
color:Colors.red,
/// other parameters/options
)
推荐阅读
- mysql - 从特定的 sql 范围获取
- c++ - 建议需要在函数中做出良好的嵌套 else/if 语句
- html - CSS渐变标题动画适合全开屏
- python - 重定向到 django 中的不同模型
- javascript - GULP:参考错误:'src'未定义
- code-signing - 使用 Azure Key Vault (HSM) 签署 VBA(宏的内部文档和/或 docx)
- c# - 如何以编程方式在 Xamarin Forms 输入字段上触发 TextChanged 事件?
- c++ - 如何构建boolstuff
- postman - 邮递员发送多个请求
- python - PyQGIS:从新图层中删除过滤器