多个过渡动画效果

代码:

// //动画实现
// return FadeTransition(
// opacity: Tween(begin: 0.0,end: 1.0)//类似于alpha 透明度效果
// .animate(CurvedAnimation(
// parent: animation1,//默认就是animation1
// curve: Curves.fastOutSlowIn//动画曲线 先快后慢 ,快出慢进等
// )),
// child: child,//传入子页面
// );//渐隐渐现


// //缩放动画
// return ScaleTransition(
// scale: Tween(begin: 0.0,end: 1.0).animate(CurvedAnimation(
// parent: animation1,
// curve: Curves.fastOutSlowIn
// )),
// child: child,//双层效果叠加的用处
// );

//旋转加缩放
// return RotationTransition(//旋转
// turns: Tween(begin: 0.0,end: 1.0)
// .animate(CurvedAnimation(
// parent: animation1,
// curve: Curves.fastOutSlowIn
// )),
// child: ScaleTransition(//缩放---此处child的作用展示出来了
// scale: Tween(begin: 0.0,end: 1.0).animate(CurvedAnimation(
// parent: animation1,
// curve: Curves.fastOutSlowIn
// )),
// child: child,//此处不能少
// ),
// );
//左右滑动动画
return SlideTransition(
position: Tween<Offset>(begin: Offset(-1.0, 0.0),end: Offset(0.0, 0.0)).animate(CurvedAnimation(parent: animation1,curve: Curves.fastOutSlowIn)),
child: child,
);
总结:

//过渡动画的其他效果

1.缩放动画

ScalTranstion

2.旋转动画

RotationTranstion

3.左右滑动动画

SliderTranstion   Tween<offset>(begin:offset(x,y),end:xxx)//x,y 从0到1

 

多个动画效果child 来添加

原文地址:https://www.cnblogs.com/pp-pping/p/12180189.html