Flutter BottomNavigationBar在顶部发光吗?

问题描述

我的问题是我的BottomNavigationBar周围有光。当我将BottomNavigationBar调暗时,我第一次看到了。希望有人可以提供帮助。

这是代码

BottomNavigationBar(
        currentIndex: selectedindex,unselectedItemColor: Colors.white,backgroundColor: Colors.black12,selectedItemColor: ASAP.info,showSelectedLabels: false,showUnselectedLabels: false,type: BottomNavigationBarType.fixed,onTap: (int i) {
          if (i == 2) {
            showSearch(context: context,delegate: SalonSearch());
            return;
          }

          setState(() {
            selectedindex = i;
          });
        },iconSize: 30,items: [
          BottomNavigationBarItem(
            icon: const Icon(MdiIcons.mapMarkerRadiusOutline),title: Text(
              "Locations",style: TextStyle(color: Colors.red,decorationColor: Colors.red),),BottomNavigationBarItem(
            icon: const Icon(MdiIcons.heartOutline),title: Text("Favourites"),BottomNavigationBarItem(
            icon: const Icon(
              MdiIcons.magnify,title: Text("Search"),],)

问候 卡尔文

解决方法

elevation中的BottomNavigationBar设置为0,以消除这种影响:

BottomNavigationBar(
        currentIndex: selectedIndex,unselectedItemColor: Colors.white,backgroundColor: Colors.black12,selectedItemColor: ASAP.info,showSelectedLabels: false,showUnselectedLabels: false,type: BottomNavigationBarType.fixed,elevation: 0,...