颤振:增加appBar图标的高度

鲍里斯先生

我想放置一个图标而不是appBar窗口小部件的标题,但是我不能为此图标设置适当的高度。

在此处输入图片说明

appBar: PreferredSize(
  preferredSize: Size.fromHeight(220.0),
  child: AppBar(
    title: Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Image.asset(
          'assets/mobile-phone.png',
          fit: BoxFit.contain,
          width: 120,
          height: 120,
        )
      ],
    ),
    elevation: 0.0,
    backgroundColor: Colors.green,
    brightness: Brightness.light,
  ),
),

尽管我将高度设置为更大,并且实际尺寸也更大,但该图标仍达到其最大大小约60(单位?)。

如何在appBar窗口小部件中强制设置图标的高度

用户名

这应该看起来像这样

appBar: PreferredSize(
  preferredSize: Size.fromHeight(220.0),
  child: AppBar(
    flexibleSpace: Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Image.asset(
          'assets/mobile-phone.png',
          fit: BoxFit.contain,
          width: 120,
          height: 120,
        )
      ],
    ),
    elevation: 0.0,
    backgroundColor: Colors.green,
    brightness: Brightness.light,
  ),
),

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章