如何禁用BottomNavBarItems上的选定索引。当我使用tallback时,它告诉我“索引2之3”,并且我想删除它。感谢您的帮助。
Widget bottomNavBar(BuildContext context) {
return BottomNavigationBar(
currentIndex: _selectedPage,
onTap: (int index) {
setState(() {
_selectedPage = index;
});
},
iconSize: 24.0,
showSelectedLabels: false,
showUnselectedLabels: false,
type: BottomNavigationBarType.fixed,
backgroundColor: Color.fromRGBO(22, 23, 27, 1.0),
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(
IconData(
67,
fontFamily: 'Glyphter',
),
color: Colors.white,
size: 27),
title: Text('Accueil'),
),
BottomNavigationBarItem(
icon: Icon(
IconData(
66,
fontFamily: 'Glyphter',
),
color: Colors.white,
size: 27),
title: Text('Téléchargement')),
BottomNavigationBarItem(
icon: Icon(
IconData(
68,
fontFamily: 'Glyphter',
),
color: Colors.white,
size: 27,
semanticLabel: 'alalalala',
),
title: Text(
'',
)),
BottomNavigationBarItem(
icon: Icon(
IconData(
65,
fontFamily: 'Glyphter',
),
color: Colors.white,
size: 27),
title: Text('Courriel')),
],
);
}
所以在BottomNavBar小部件中,我有一个底部的导航栏项目,它是一个表。当我使用“话语提示”时,我只想说“主页”,“下载”等...但是它也告诉我索引在表中的位置(索引2在4中)。我不知道如何删除这些多余的信息。
谢谢您的帮助!