Flutter中的底部导航栏

时间:2020-08-03 12:44:49

标签: flutter dart flutter-bottomnavigation

我是扑扑的新手。我已经在flutter中创建了一个底部导航栏。但是我想要的设计如下所示:

BottomNavigationBar(
        currentIndex:
            _currentIndex, // this will be set when a new tab is tapped
        selectedItemColor: Colors.black54,
        unselectedItemColor: Colors.black,
        onTap: onTabTapped, // new
        items: [
          BottomNavigationBarItem(
            icon: new Icon(Icons.home),
            title: new Text('Home'),
          ),
          BottomNavigationBarItem(
            icon: new Icon(Icons.lightbulb_outline),
            title: new Text('Coding Tips'),
          ),
          BottomNavigationBarItem(
              icon: Icon(Icons.library_books), title: Text('Books')),
          BottomNavigationBarItem(icon: Icon(Icons.chat), title: Text('Forum')),
          BottomNavigationBarItem(
              icon: Icon(Icons.image), title: Text('Fun Area'))
        ],
      ),

我现在拥有的是:

enter image description here

我想要的是:

enter image description here

如何在图标右侧显示文字?另外,如何创建按效果?任何帮助表示赞赏!

0 个答案:

没有答案