抽屉导航的汉堡图标颜色未更改。默认情况下为黑色。我想在 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")
        ),
       ),
     );
    }
 }

最佳答案

将主题图标添加到您的AppBar

@override
Widget build(BuildContext context) {
  return Scaffold(
    drawer: Drawer(),
    appBar: AppBar(
      title: Text("Navigation Drawer"),
      iconTheme: IconThemeData(color: Colors.green),
    ),
  );
}
您还可以检查other solutions here.

关于navigation-drawer - flutter 抽屉导航汉堡包图标颜色更改,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50580234/

10-09 10:18