flutterflutter-layoutflutter-dependenciespopupmenubutton

In a ListTitle PopupMenuButton works in debug but not in release mode in flutter


It's working when I keep it in AppBar. But in ListTile it's not working.

It's working in debug build not working in release build. May I know what's the issue exactly..

In my case when I add PopupMenuButton the button itself not showing in release build.

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',
                  )),
            ]);
  }

Solution

  • In my case the problem was in a ListTitle PopupMenuButton was not taking. I have added a row and inside a row I have added ListTitle container with width and PopupMenuButton.

     @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',
                      )),
                ]);
      }