首页 > 解决方案 > 如何修复不在颤振中心的应用栏

问题描述

当我打开我的重新订购页面时,我的应用栏标题由于后退按钮而不是中心,所以我想知道如何让应用栏始终居中,以便与其他屏幕相同。

任何帮助或建议将不胜感激。

      appBar: AppBar(
        centerTitle: true,
        title: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              "Maxis",
              style:
                  TextStyle(fontFamily: "Raleway", fontWeight: FontWeight.w300),
            ),
            Image.asset(
              "assets/images/maxis.png",
              width: 30,
            ),
            Text(
              "Mobile",
              style:
                  TextStyle(fontFamily: "Raleway", fontWeight: FontWeight.w300),
            ),
          ],
        ),
      ),

在此处输入图像描述

标签: androidflutterdartmobileappbar

解决方案


  mainAxisSize: MainAxisSize.min,

您需要在 Row 小部件中使用它,它将完美居中。

在此处输入图像描述


推荐阅读