简体   繁体   English

如何在我的 flutter 应用程序中使汉堡图标更大

[英]how can i make the burger icon bigger in my flutter app

i cant seem to figure out how to make the burger icon bigger in my flutter app我似乎无法弄清楚如何在我的 flutter 应用程序中使汉堡图标更大

我的

here is the code for my flutter app, i am simply trying to make it bigger.....................................................................................................................................................这是我的 flutter 应用程序的代码,我只是想让它更大.................................. ..................................................... ..................................................... ......

return new Scaffold(

  backgroundColor: Colors.transparent,
  appBar: AppBar(
    backgroundColor: Colors.transparent,
    elevation: 0.0,
          iconTheme: new IconThemeData(color: Colors.black),

  ),
        extendBodyBehindAppBar: true,
drawer: Drawer(
        // Add a ListView to the drawer. This ensures the user can scroll
        // through the options in the drawer if there isn't enough vertical
        // space to fit everything.
       
        child: ListView(
          // Important: Remove any padding from the ListView.
          padding: EdgeInsets.zero,
          children: <Widget>[
            DrawerHeader(
              child: Text('Drawer Header', ),
              decoration: BoxDecoration(
                color: Colors.black,
              ),
            ),
            ListTile(
              title: Text('Trip History',style : TextStyle(fontSize: 20.0,fontFamily:"Clan-Medium")),
              onTap: () {
                // Update the state of the app
                // ...
                // Then close the drawer
                Navigator.pop(context);
              },
            ),
            ListTile(
              title: Text('Payment',style : TextStyle(fontSize: 20.0,fontFamily:"Clan-Medium")),
              onTap: () {
                // Update the state of the app
                // ...
                // Then close the drawer
                Navigator.pop(context);
              },
            ),
            ListTile(
              title: Text('Settings',style : TextStyle(fontSize: 20.0,fontFamily:"Clan-Medium")),
              onTap: () {
                // Update the state of the app
                // ...
                // Then close the drawer
                Navigator.pop(context);
              },
            ),

          ],
        ),
      ),

Change your AppBar to this and then focus on the size property of the Icon, Change it as you want.将您的 AppBar 更改为此,然后关注 Icon 的size属性,根据需要进行更改。

appBar: AppBar(
    backgroundColor: Colors.transparent,
    elevation: 0.0,
    iconTheme: new IconThemeData(color: Colors.black),
    leading: IconButton(
        icon: Icon(
                   Icons.menu,
                   color: Colors.black,
                   size: 24.0,
                  ),
        onPressed: (){
           _scaffoldKey.currentState.openDrawer();
        },
   )
),

You can set any icon here.您可以在此处设置任何图标。

Also, as the official docs say, you can use it as well which also has an option to set ToolTip .此外,正如官方文档所说,您也可以使用它,它还有一个设置ToolTip的选项。

AppBar(
  leading: Builder(
    builder: (BuildContext context) {
      return IconButton(
        icon: const Icon(Icons.menu),
        onPressed: () { Scaffold.of(context).openDrawer(); },
        tooltip: MaterialLocalizations.of(context).openAppDrawerTooltip,
      );
    },
  ),
)

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

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