0

How can I narrow the width of the popup menu in the navbar? How can I zoom the icon and text? I can't open the width tag, I think a different customization is required.

now it looks like this

actions: <Widget>[
      PopupMenuButton<_MenuValues>(
      color: const Color(0xFF212121),
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.all(Radius.circular(15.0))
      ),
      itemBuilder: (BuildContext context) => [
        PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.settings, color: Colors.white),
              title: Text("Settings", style: TextStyle(color: Colors.white)),
            ),
            value: _MenuValues.settings
            ),
      ],
      onSelected: (value) {
          switch(value) {
            case _MenuValues.settings:
              Navigator.of(context).push(MaterialPageRoute(
                builder: (context) => settings(),
              ));
              break;
          }
        },
      ),
    ],
Junsu Cho
  • 826
  • 7
  • 16

1 Answers1

0

use sizedBox

          PopupMenuItem(
            value: 1,
            // row has two child icon and text.
            child: SizedBox(
              width: 500,
              child: Row(
                children: [
                  Icon(Icons.settings , size: 10,),
                  Text("Settings", style: TextStyle(fontSize: 10),)
                ],
              ),
            )
          ),
        ],

enter image description here

Junsu Cho
  • 826
  • 7
  • 16
  • Here's how I solved the zoom. PopupMenuItem( child: ListTile( leading: Icon(Icons.settings, color: Colors.white), title: Transform( transform: Matrix4.translationValues(-16, 0.0, 0.0), child: Text("Settings", style: TextStyle(color: Colors.white)), ), ), value: _MenuValues.settings ), – Serdar Bilgili Jul 19 '22 at 09:21
  • I couldn't figure out collapsing the menu from the sides. – Serdar Bilgili Jul 19 '22 at 09:22