BottomAppBar浮动操作按钮的凹口/插入不透明 [英] BottomAppBar Floating action button notch/inset is not transparent

查看:96
本文介绍了BottomAppBar浮动操作按钮的凹口/插入不透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在materialApp的脚手架中添加了BottomAppBar,为此,我添加了一个在中心具有嵌入物的fab.代码看起来像这样

I've added a BottomAppBar to scaffold in a materialApp, and to that I've added a fab with a inset at the center. The code looks somewhat like this

Scaffold(
    bottomNavigationBar: BottomAppBar(
        color: Theme.of(context).accentColor,
        shape: CircularNotchedRectangle(),
        child: _buildBottomBar(context),
    ),
    floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
    floatingActionButton: FloatingActionButton(
        backgroundColor: Theme.of(context).primaryColor,
        child: Center(
        child: Icon(
            Icons.add,
            size: 32.0,
        ),
        ),
        onPressed: () {
        Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => CreateEvent()),
        );
        },
    ),
)

这就是渲染后我得到的:

And this is what I'm getting after rendering:

该凹口不是透明的,并且其背后的内容被隐藏了.

The notch is not transparent, and the content behind it is getting hidden.

是否可以解决此问题?我可能会错过的东西吗?

Is there a way to fix this? Something I might have missed?

推荐答案

您只需要进入flutter频道: master ,然后添加到Scaffold:

You just need to be on the flutter channel: master and then add to Scaffold:

Scaffold(
   extendBody: true
);

它应该是透明的:)

礼物

钢筋

这篇关于BottomAppBar浮动操作按钮的凹口/插入不透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆