【发布时间】:2018-11-02 15:05:36
【问题描述】:
我有一个底部导航栏的应用:
BottomNavigationBar(
type: BottomNavigationBarType.fixed,
items: [
BottomNavigationBarItem(
icon: Image.asset('assets/icons/inactive/sth.png'),
activeIcon: Image.asset('assets/icons/active/sth.png'),
title: Text('Sth')
),
BottomNavigationBarItem(
icon: Image.asset('assets/icons/inactive/sth.png'),
activeIcon: Image.asset('assets/icons/active/sth.png'),
title: Text('Sth')
),
],
onTap: (int index) {
_currentIndex = index;
},
currentIndex: _currentIndex
)
现在我有一些用例,我想显示 bottomNavigationBar 但它的所有项目都不应该处于活动状态。
将 currentIndex 设置为不存在的索引时,我得到了预期的错误。
有什么方法可以实现我的目标吗?
提前谢谢你。
【问题讨论】:
-
那么,您检查了答案,找到了您想要的吗?