Flutter PopupMenuButton 删除飞溅和突出显示

GIL*_*ILO 1 dart flutter

我想知道是否有一种方法可以像其他按钮一样从 PopupMenuButton 中删除飞溅和突出显示。

new PopupMenuButton({
  ...
  splashColor: Colors.transparent,  
  highlightColor: Colors.transparent, // makes highlight invisible too
})
Run Code Online (Sandbox Code Playgroud)

Kah*_*hou 7

主题将主题应用于后代小部件。

Theme(
  data: Theme.of(context).copyWith(
    highlightColor: Colors.transparent,
    splashColor: Colors.transparent,
  ),
  child: PopupMenuButton(...),
)
Run Code Online (Sandbox Code Playgroud)