我试图在选定的BottomNavigationBarItem上显示一个条,如下所示。这正是我所需要的。
BottomNavigationBar(
type: BottomNavigationBarType.fixed,
currentIndex: currentIndex,
fixedColor: Colors.blue[800],
onTap: (value) {
},
items: [
BottomNavigationBarItem(
icon: Icon(
FontAwesomeIcons.shopify,
size: 21.0,
),
title: Text(
'Abc',
)),
BottomNavigationBarItem(
icon: Icon(
Icons.shop,
size: 21.0,
),
title: Text(
'Second Tab',
)),
),
],
),
参考图片
答案 0 :(得分:0)
BottomNavigationBar
中的默认Flutter
不支持此行为。要在Flutter中为BottomNavigationBar
获得这种行为。您必须创建自己的小部件。
但是下面的软件包可以帮助您轻松实现这一目标。检查以下链接以获取该软件包: