How to open a PopupMenuButton?

后端 未结 6 1747
暗喜
暗喜 2021-01-07 17:34

How do I open a popup menu from a second widget?

final button = new PopupMenuButton(
    itemBuilder: (_) => >[
                 


        
6条回答
  •  误落风尘
    2021-01-07 18:22

    I don't think there is a way to achieve this behaviour. Although you can attach an onTap attribute to the tile, you can't access the MenuButton from the 'outside'

    An approach you could take is to use ExpansionPanels because they look like ListTiles and are intended to allow easy modification and editing.

提交回复
热议问题