flutter - 如何在 Flutter 中将标签空间禁用到 bottomNavigationBa

我正在尝试自定义 bottomNavigationBar。我的意图是删除标签占用空间,包括边距和填充。我想将内容水平和垂直居中到这个空间。

我的代码:

bottomNavigationBar: Container(
            child: ClipRRect(
          borderRadius: BorderRadius.only(
            bottomLeft: Radius.circular(30.0),
            bottomRight: Radius.circular(30.0),
          ),
          child: BottomNavigationBar(
            items: const <BottomNavigationBarItem>[
              BottomNavigationBarItem(
                icon: Icon(
                  Icons.pause,
                  color: Colors.white,
                  size: 40,
                ),
                label: '',
              ),
              BottomNavigationBarItem(
                icon: Text(
                  "Imagine . Ariana Grande",
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 13,
                    fontWeight: FontWeight.w400,
                  ),
                ),
                label: '',
              ),
              BottomNavigationBarItem(
                icon: Icon(
                  Icons.arrow_circle_up,
                  color: Colors.white,
                  size: 35,
                ),
                label: '',
              ),
            ],
            //currentIndex: ,
            selectedItemColor: Colors.white,
            //onTap: ,
            backgroundColor: Colors.blue,
          ),

结果:

我想要这个:

最佳答案

可以通过BottomNavigationBar中的一个属性selectedFontSize: 0

来解决

关于flutter - 如何在 Flutter 中将标签空间禁用到 bottomNavigationBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66936045/

相关文章:

c# - 手动创建 JSON

flutter - 运算符 '*' 不能无条件调用,因为接收者可以是 'null' 。尝试向目标 (

arrays - 无法打印字符串常量数组字符串的内容?

docker - 未知速记标志 : 'a' in -a in docker

r - 如何根据在ggplot中分配的概率对单词重新排序

javascript - 数组 .includes() 给出意外行为

java - 如何总结对象流的数字属性?

java - 使用 java Supplier 接口(interface)创建条件对象

java - 将 java.util.function.Function 定义为 static fi

python - Django 在速记渲染方法中添加自定义 header