现在我在flutter中使用appbar,但它覆盖了手机的时间\网络\电池,我应该怎么做才能让它显示出来,这是我的appbar代码:
child: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(
context,
),
sliver: SliverAppBar(
title: Text(
'Cruise',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
pinned: true,
floating: true,
forceElevated: innerBoxIsScrolled,
actions: [
IconButton(
onPressed: () => Navigator.push(
context,
MaterialPageRoute(builder: (context) => AddChannel()),
),
icon: Icon(Feather.plus),
),
],
)),
];
},用户界面如下所示:

发布于 2020-11-08 23:11:48
您可以将所有这些都包装在一个SafeArea中。它是一个小部件,可以帮助你自动避免屏幕上的凹痕等等。SafeArea Class documentation
https://stackoverflow.com/questions/64739001
复制相似问题