颤振导航抽屉汉堡包图标颜色更改 [英] Flutter navigation drawer hamburger icon color change

查看:96
本文介绍了颤振导航抽屉汉堡包图标颜色更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

导航抽屉的汉堡包图标颜色未更改.默认情况下为黑色.我想在抖动中更改此图标的颜色,我被卡住了,请帮助我更改此图标的颜色.这是我的代码.

Hamburger icon color of navigation drawer is not changing. Its black by default. I want to change the this icon color in flutter, I am stuck, help me to change this icon color. here is my code.

class Test extends StatefulWidget {
@override
_TestState createState() => new _TestState();
}

class _TestState extends State<Test> {


    @override
    Widget build(BuildContext context) {
    return new Scaffold(

    drawer: new Drawer(),
    appBar: new AppBar(
    title: new Text("Navigation Drawer")
        ),
       ),
     );
    }
 }

推荐答案

iconTheme 添加到您的AppBar

Add iconTheme to your AppBar

@override
Widget build(BuildContext context) {
  return new Scaffold(
    drawer: new Drawer(),
    appBar: new AppBar(
      title: new Text("Navigation Drawer"),
      iconTheme: new IconThemeData(color: Colors.green),
    ),
  );
}

这篇关于颤振导航抽屉汉堡包图标颜色更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆