Container(
width: 47.5,
height: 47.5,
child: Image.asset(
CommonUtils.getAssertImagePath('home_label_menu'),
color: Colors.black,
width: 20,
height: 20,
),
),
如上面这样写代码之后发现图片并不是20而是47.5
在container和iamge中间插一个控件就解决了
Container(
width: 47.5,
height: 47.5,
child: Center(
child: Image.asset(
CommonUtils.getAssertImagePath('home_label_menu'),
color: Colors.black,
width: 20,
height: 20,
),
),
),