删除 BottomNavigationBarItem 上按下时的覆盖

Moh*_*ily 1 flutter flutter-test flutter-dependencies flutter-animation

在此输入图像描述

BottomNavigationBar(
        elevation: 10,
        type: BottomNavigationBarType.fixed,
        backgroundColor: Color(0xFFFBFBFB),
        showSelectedLabels: false,
        showUnselectedLabels: false,
        items: <BottomNavigationBarItem>[
          BottomNavigationBarItem(
            icon: Column(
              children: [
                Text(
                  AppLocalizations.of(context)!.redeem,
                  style: Styles.grey13Medium,
                )
              ],
            ),
            activeIcon: Column(
              children: [
                Text(
                  AppLocalizations.of(context)!.redeem,
                  style: Styles.blue13Medium,
                )
              ],
            ),
            label: 'Redeem',
          ),
        ],
        currentIndex: _currentTab,
        onTap: _onItemTapped,
      )
Run Code Online (Sandbox Code Playgroud)

我们尝试更改叠加层,但我没有在 BottomNavigationBar 和 BottomNavigationBarItem 中找到叠加层属性

小智 5

让你的代码更具可读性

如果您想删除底部导航栏上的飞溅,您可以将其颜色设置为透明,

Theme(
  data: Theme.of(context).copyWith(
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
  ),
  child: ChildWidget(),
);
Run Code Online (Sandbox Code Playgroud)