首页 > 解决方案 > 在 Flutter 中更改 AppBar 后退图标大小

问题描述

这是当前AppBar代码:

AppBar(
  iconTheme: IconThemeData(
    color: Colors.black,
    size: 100 // This isn't performing any changes
  ),
  centerTitle: false,
  backgroundColor: Colors.white,
  title: Text(
    title,
    style: TextStyle(color: Colors.black87,

  ),
  elevation: 1.0,
);

当前尺寸属性IconThemeData不做任何改变。

标签: androidflutterdartflutter-appbar

解决方案


试试这个你需要使用leading

  • 在标题之前显示的小部件。

示例代码

 AppBar(
      title: new Text("Your Title"),
      leading: new IconButton(
        icon: new Icon(Icons.arrow_back,size: 50.0,),
        onPressed: () => {
          // Perform Your action here
        },
      ),
    );

输出

在此处输入图像描述


推荐阅读