【发布时间】:2021-08-07 20:07:24
【问题描述】:
我有一个 Flutter 应用程序,它有一个 BottomNavigationBar,它的图标是用 svg 制作的。从该栏中选择图标时,只有文本更改颜色,svg 图标保持相同颜色。
bottomNavigationBar: BottomNavigationBar(
selectedItemColor: widget._colors.orange,
unselectedItemColor: widget._colors.grey,
items: _iconNavBar,
currentIndex: _index,
type: BottomNavigationBarType.fixed,
onTap: onTap,
),
BottomNavigationBarItem() 的表现示例
BottomNavigationBarItem(
icon: SvgPicture.asset(
'svgs/home.svg',
),
label: 'Home')
【问题讨论】: