在 ListTitle PopupMenuButton 在调试中工作,但在颤振中不在发布模式下工作

问题描述

当我将它保存在 AppBar 中时它正在工作。但是在 ListTile 中它不起作用。

它在调试版本中有效,但在发布版本中无效。我可以知道具体是什么问题吗..

在我的情况下,当我添加 PopupMenuButton 时,按钮本身没有显示在发布版本中。

Widget popupMenu() {
    return PopupMenuButton(
        color: Colors.white,icon: Icon(
          Icons.more_vert,size: 30,color: Colors.black,),onSelected: (value) {
          //conditions check
         
        },itemBuilder: (context) => [
              PopupMenuItem(
                  value: 'Message',child: Text(
                    'Message',)),]);
  }

解决方法

就我而言,问题出在 ListTitle PopupMenuButton 没有被占用。我添加了一行,并在一行内添加了具有宽度和 PopupMenuButton 的 ListTitle 容器。

 @override
  Widget build(BuildContext context) {
    return new Column(
      children: <Widget>[
        new Container(
          child: Align(
            alignment: Alignment.centerLeft,child: new Row(
              children: <Widget>[
                new Container(
                  width: MediaQuery.of(context).size.width - 50,child: new Column(
                    mainAxisAlignment: MainAxisAlignment.spaceEvenly,children: <Widget>[
                      ListTile(
                        dense: true,),],popupMenu(aspirantCardVO),)
      ],);
  }


Widget popupMenu() {
    return PopupMenuButton(
        color: Colors.white,icon: Icon(
          Icons.more_vert,size: 30,color: Colors.black,onSelected: (value) {
          //conditions check
         
        },itemBuilder: (context) => [
              PopupMenuItem(
                  value: 'Message',child: Text(
                    'Message',)),]);
  }

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...