I want to use a UK flag in buttom navigation bar, but the UK flag does not appear and only shows a purole color. When I put another photo (a transparent photo with letter Z written on it), it appears, nonetheless as balck and white. But the UK flag just gives me a purple color.
Here is my code:
bottomNavigationBar: CupertinoTabBar(
activeColor: currentTheme.iconTheme.color,
backgroundColor: currentTheme.backgroundColor,
items: const [
BottomNavigationBarItem(
icon: ImageIcon(
AssetImage('assets/images/uk_one.png'),
color: null,
),
label: '',
],
onTap: onPageChanged,
currentIndex: _page,
),
I tried commenting out activeColor and backgroundColor, but it did not fix the issue.
2
Answers
Use Image.asset in place of ImageIcon in BottomNavigationBarItem.
Hope it helps.
As
icon:
takes a widget you can directly assignImage widget
or elsetry this instead