我正在使用 flutter PopUpMenuButton。我想要的是,当我选择菜单上的任何项目时,不应关闭弹出窗口,而是让我从弹出窗口中选择多个值。文档说您可以覆盖 handleTap 属性,但我不清楚该怎么做那?这是有记录的
///The [handleTap] method can be overridden to adjust exactly what happens when
/// the item is tapped. By default, it uses [Navigator.pop] to return the
/// [PopupMenuItem.value] from the menu route.
void handleTap() {
Navigator.pop<T>(context, widget.value);
}
Run Code Online (Sandbox Code Playgroud)