简体   繁体   English

如何折叠 Flutter 中的弹出菜单

[英]How to collapse the popup menu in Flutter

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.我无法打开宽度标签,我认为需要进行不同的自定义。

现在看起来像这样

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

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),)
                ],
              ),
            )
          ),
        ],

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM