我正在创建一个导航栏,我已经把不同的图像作为图标在这里,我如何在这里增加图像大小.图像是存在于ImageIcon内Assetimage.当我尝试使用ImageIcon中的大小来增加图像大小时,它不起作用.
Container(
width: size.width,
height: 80,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
IconButton(
icon: ImageIcon(
AssetImage(
'assets/about.png',
),
color:
currentIndex == 0 ? Colors.blue : Colors.black,
),
onPressed: () {
setBottomBarIndex(0);
},
splashColor: Colors.white,
),
IconButton(
icon: ImageIcon(
AssetImage('assets/skills.png'),
color: currentIndex == 1
? Colors.blue
: Colors.black,
),
onPressed: () {
setBottomBarIndex(1);
}),
Container(
width: size.width * 0.20,
),
IconButton(
icon: ImageIcon(
AssetImage('assets/projects.png'),
color: currentIndex == 2
? Colors.blue
: Colors.black,
),
onPressed: () {
setBottomBarIndex(2);
}),
IconButton(
icon: ImageIcon(
AssetImage('assets/blog.png'),
color: currentIndex == 3
? Colors.blue
: Colors.black,
),
onPressed: () {
setBottomBarIndex(3);
}),
],
),
)
字符串
1条答案
按热度按时间f0ofjuux1#
使用Transform将图标按钮包裹起来。
字符串