1

我的问题是我的 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"),
          ),
        ],
      )

问候卡尔文

4

1 回答 1

1

将 的 设置elevationBottomNavigationBar0 以消除该效果:

BottomNavigationBar(
        currentIndex: selectedIndex,
        unselectedItemColor: Colors.white,
        backgroundColor: Colors.black12,
        selectedItemColor: ASAP.info,
        showSelectedLabels: false,
        showUnselectedLabels: false,
        type: BottomNavigationBarType.fixed,
        elevation: 0,
...
于 2020-08-10T19:21:23.440 回答