[英]Flutter - Padding on AppBar
我正在开发的应用程序必须始终处于全屏模式,但是,时间/日期也必须始终显示,以及某个硬件 ID。 我们找到了以下方式来呈现所述信息:
但是,正如您在上面看到的,我用红色标记了一个始终位于我的 AppBar 上方的 Padding 小部件,我们希望删除该填充。 这样的事情可能吗?
下面我有我们正在使用的自定义 AppBar 的代码。
@override
Widget build(BuildContext context) {
return PreferredSize(
preferredSize: Size.fromHeight(45),
child: AppBar(
centerTitle: true,
title: Column(
children: <Widget>[
Text(pageName,
style: TextStyle(
fontSize: pageNameFontSize
),
),
SizedBox(
height: 8,
)
],
),
actions: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
SizedBox(
height: 6,
),
Row(
children: <Widget>[
AppBarClock(
style: TextStyle(
fontSize: 20
),
),
SizedBox(
width: 5,
)
],
),
Row(
children: <Widget>[
Text(this.trailText,
textAlign: TextAlign.right,
),
SizedBox(
width: 5,
)
],
),
],
)
],
),
);
我们正在使用SystemChrome.setEnabledSystemUIOverlays([]); 使应用程序全屏显示。
那是因为AppBar
自动包含一个SafeArea
每当被视为主要。
只需将它的primary
属性设置为false
。
AppBar(
primary: false,
...
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.