【发布时间】:2019-07-08 02:02:29
【问题描述】:
flutter中如何改变PopupMenuItem的背景颜色?
现在我只是改变了PopupMenuItem的child的颜色,结果是这样的:
代码如下:
PopupMenuButton<int>(
onSelected: (value) {
// TODO: Implement onSelect
},
offset: Offset(50, 50),
itemBuilder: (context) => [
PopupMenuItem(
value: 1,
child: Container(
height: double.infinity,
width: double.infinity,
color: Colors.greenAccent, // i use this to change the bgColor color right now
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Icon(Icons.check),
SizedBox(width: 10.0),
Text("Konfirmasi Update"),
SizedBox(width: 10.0),
],
),
),
),
我想要的是更改“Konfirmasi Update”选项的背景颜色,如上图所示,颜色是在选项之外留下白色区域。
如何完全改变PopupMenuItem的背景颜色,而不留下PopupMenuItem外面的白色区域?
【问题讨论】: