微信交流群

# PopupMenuTheme

用于PopupMenu的样式。

PopupMenuTheme(
  data: PopupMenuThemeData(
    color: Colors.red
  ),
  child: PopupMenuButton<String>(
    itemBuilder: (context) {
      return <PopupMenuEntry<String>>[
        PopupMenuItem<String>(
          value: '语文',
          child: Text('语文'),
        ),
        PopupMenuItem<String>(
          value: '数学',
          child: Text('数学'),
        ),
        PopupMenuItem<String>(
          value: '英语',
          child: Text('英语'),
        ),
      ];
    },
  ),
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

image-20200528155906864

# PopupMenuThemeData

样式说明:

const PopupMenuThemeData({
  this.color,//背景颜色
  this.shape,//形状
  this.elevation,//阴影
  this.textStyle,//文本样式
})
1
2
3
4
5
6