【问题标题】:how to show the battery icon network icon and so on by default in flutter [duplicate]如何在flutter中默认显示电池图标网络图标等[重复]
【发布时间】:2021-04-21 22:46:21
【问题描述】:

当我打开 Flutter 应用时,手机的电池图标和网络图标消失了。这是我的应用条码:

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,
                expandedHeight: 10.0,
                floating: true,
                snap: true,
                forceElevated: innerBoxIsScrolled,
                actions: [
                  if (state.currentStoriesType == StoriesType.channels)
                    IconButton(
                      onPressed: () => {dispatch(HomeListActionCreator.onJumpAddChannel())},
                      icon: Icon(Feather.plus),
                    ),
                ],
              )),
        ];
      },

如何使图标默认显示?现在这个图标消失了:

【问题讨论】:

标签: flutter


【解决方案1】:

使用小部件SafeArea 它会提供您想要的。 将您的顶部小部件包含在其中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-10
    • 2015-02-05
    • 2020-11-22
    • 2018-07-16
    • 2013-06-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多