flutter动画和进行图片的加载

1.进行简单的移动,旋转等动画操作,具体的操作可以查看api
transform: new Matrix4.rotationZ(0.1), 沿z轴旋转
transform: new Matrix4.translationValues(10.0, 30.0, 30.0),
2.对于Container中可以使用foregroundDecoration属性,但是不知道为什么decoration属性使用时会报错。
foregroundDecoration: new BoxDecoration(
image: new DecorationImage(
// fit: BoxFit.fill,
image: new NetworkImage(
https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1540975544992&di=43aad7fa69828bc65d942873e663aa49&imgtype=0&src=http%3A%2F%2Fpic.58pic.com%2F58pic%2F15%2F93%2F57%2F63258PICCZg_1024.jpg’),
// centerSlice: new Rect.fromLTRB(10.0, 10.0, 10.0, 10.0),
),
),

3.进行文件夹中的图片的加载需要在pubspec.yaml中进行配置路径
在这里插入图片描述
但是在这里很明显指定宽高并没有什么作用。如果想起作用,应该放在其他的父容器之中才可以。
在这里插入图片描述
比如在下面的情况,宽高就生效了
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/yuezheyue123/article/details/83584263