【发布时间】:2019-02-04 13:29:39
【问题描述】:
我正在制作一个高度高于典型 AppBar 的自定义 AppBar。我也想调整前导小部件/图标的大小,并利用automaticallyImplyLeading 默认行为(因此菜单图标和后退图标会自动实现)。
这是我认为我会实施的解决方案:
class AppAppBar extends PreferredSize{
AppAppBar(String title) : super(
preferredSize: Size.fromHeight(56.0),
child: AppBar(
centerTitle: true,
title: Text(title, style: textStyle)
)) {
(child as AppBar).leading =
SizedBox(width: 30.0, height: 30.0, child: (child as AppBar).leading);
}
static const textStyle = TextStyle(fontSize: 32.0);
}
但这当然行不通,因为(child as AppBar).leading 是最终的。
因此,在下面的 AppBar 中(为了便于说明,文本大小显着变大),我想将自动添加的汉堡图标设置得更大。
你怎么看?是否有解决方案或者我应该放弃自动图标并自己添加它们?
编辑:添加了一张图片来说明我的意思
【问题讨论】:
-
你能放一张你想要的图片吗?
标签: flutter