一尘不染

颤振导航抽屉汉堡包图标颜色更改

flutter

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

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

阅读 214

收藏
2020-08-13

共1个答案

一尘不染

iconTheme 添加到您的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),
    ),
  );
}
2020-08-13