代码:
child: Container(
child: new Image.network(
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1578312966654&di=09a975b6c05a1447fc6f8aeae463cf41&imgtype=0&src=http%3A%2F%2Fp2.qhimgs4.com%2Ft0128307802c64fd817.jpg',
// fit: BoxFit.fill,
// color: Colors.greenAccent,
// colorBlendMode: BlendMode.modulate,
repeat: ImageRepeat.repeatX,
),
width: 500.0,
height: 300.0,
color: Colors.lightBlue,
)
总结
Image 图片
child :new Image.network{
fit:BoxFit.scaleDown//默认样式-图片原大小
BoxFit.fill //图片填充容器大小,会拉伸
BoxFit.cover //图片填充容器大小,会裁剪
//给图片添加层颜色
color:Colors.green
colorBrendMode:BlendMode.modulate,//图层混合和 颜色
repeat:ImageRepeat.repeatX//对X轴做图片复制
}