Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TranslateTransition extends AnimatedWidget {
- const TranslateTransition({
- Key key,
- @required Animation<double> translate,
- this.alignment = Alignment.center,
- this.child,
- }) : super(key: key, listenable: translate);
- Animation<double> get translate => listenable;
- final Alignment alignment;
- final Widget child;
- @override
- Widget build(BuildContext context) {
- final double translateValue = translate.value;
- final Matrix4 transform = Matrix4.identity()
- // ..translate(translateValue, translateValue, 1.0);
- ..translate(translateValue);
- return Transform(
- transform: transform,
- alignment: alignment,
- child: child,
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement