如何在flutter中制作透明的底部导航栏

Mah*_*ahi 0 transparent dart flutter bottomnavigationview

应用程序屏幕上覆盖着图像,有一个底部应用程序栏,我需要将背景图像视为透明。

我使用 svg 图标作为底部导航栏图标。同一屏幕顶部应用栏是透明的,但底部应用栏显示白色。



  BottomAppBar _buildBottomNavigationBar() {
    return BottomAppBar(
      color: Colors.transparent,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          IconButton(
            onPressed: () {},
            icon: SvgPicture.asset(
              'assets/icons/home.svg',
              color: Colors.black,
            ),
            //color: Colors.black,
          ),
          IconButton(
            onPressed: () {},
            icon: SvgPicture.asset('assets/icons/location.svg'),
            color: Colors.black,
          ),
          IconButton(
            onPressed: () {},
            icon: SvgPicture.asset('assets/icons/fish.svg'),
            color: Colors.black,
          ),
          IconButton(
            onPressed: () {},
            icon: SvgPicture.asset('assets/icons/menu.svg'),
            color: Colors.black,
          ),
        ],
      ),
    );
  }

Run Code Online (Sandbox Code Playgroud)

Jim*_*hiu 6

尝试这个:

Scaffold(
  extendBody: true,
Run Code Online (Sandbox Code Playgroud)