-
-
Save Rahiche/a5c6c8b970a0d897f365166d4541eb6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
transitionBuilder: (Widget child, Animation<double> animation) { | |
final inAnimation = | |
Tween<Offset>(begin: Offset(1.0, 0.0), end: Offset(0.0, 0.0)) | |
.animate(animation); | |
final outAnimation = | |
Tween<Offset>(begin: Offset(-1.0, 0.0), end: Offset(0.0, 0.0)) | |
.animate(animation); | |
if (child.key == ValueKey(elapsed)) { | |
return ClipRect( | |
child: SlideTransition( | |
position: inAnimation, | |
child: Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: child, | |
), | |
), | |
); | |
} else { | |
return ClipRect( | |
child: SlideTransition( | |
position: outAnimation, | |
child: Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: child, | |
), | |
), | |
); | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment