Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How to remove space in vertical for the showMenu function?

$
0
0

I use the showMenu function to show menus with dialog.My code is

      const width = 100.0;      const height = 40.0;      await showMenu(        items: [          PopupMenuItem(padding: EdgeInsets.zero, child: Container(width: width, height: height, color: Colors.blue, child: const Text('test 1'))),          PopupMenuItem(padding: EdgeInsets.zero, child: Container(width: width, height: height, color: Colors.blue, child: const Text('test 2'))),        ],        context: context,        position: const RelativeRect.fromLTRB(0, 0, 0, 0),        constraints: const BoxConstraints(maxWidth: width, maxHeight: height * 2),        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),        color: Colors.red,      );

I tried to fit it by setting the maxWidth and maxHeight of the constraints property in the showMenu, the horizontal is working but the vertical still has space between menus.

enter image description here


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>