How to change the appBar back button color

前端 未结 9 642
慢半拍i
慢半拍i 2021-01-30 11:54

I cannot figure out how to change the appBar\'s automatic back button to a different color. it\'s under a scaffold and I\'ve tried to research it but I can\'t wrap my head aroun

9条回答
  •  盖世英雄少女心
    2021-01-30 12:47

    you can also override the default back arrow with a widget of your choice, via 'leading':

    leading: new IconButton(
      icon: new Icon(Icons.arrow_back, color: Colors.orange),
      onPressed: () => Navigator.of(context).pop(),
    ), 
    

    all the AppBar widget does is provide a default 'leading' widget if it's not set.

提交回复
热议问题