Используя пример:
transitionDuration: Duration(milliseconds: 5000),
pageBuilder: (context, animation, secondaryAnimation) => page,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
var begin = Offset(1.0, 0.0);
var end = Offset.zero;
var curve = Curves.elasticIn;
var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
print("primary: ${animation}");
return SlideTransition(
position: animation.drive(tween),
child: child,
);
},
);
Параметр animation
в transitionBuilder
содержит свойство status
, которое возвращает AnimationStatus
.
Простое
var curve = animation.status == AnimationStatus.reverse ? Curves.elasticIn : Curves.elasticOut ;
сделает.