おはようございます
どんどん寒くなり、今年もまもなく終わりになります。
頑張りましょう。
以前の投稿(連関)
Stateful
Stateful でつかいます。
Curved Animation
animation = CurvedAnimation(parent: animationController, curve: Curves.bounceOut);
animation.addStatusListener((status) {
if (status == AnimationStatus.completed) {
animationController.reverse();
} else if (status == AnimationStatus.dismissed) {
animationController.forward();
}
});
class AnimatedLogo extends AnimatedWidget {
final Tween<double> _sizeAnim = Tween<double>(begin: 0.0, end: 500.0);
// final CurvedAnimation _sizeAnim = CurvedAnimation(begin: 0.0, end: 500.0);
AnimatedLogo({Key key, Animation animation})
: super(key: key, listenable: animation);
@override
Widget build(BuildContext context) {
// TODO: implement build
final Animation<double> animation = listenable;
return Transform.scale(
scale: animation.value * 50,
child: FlutterLogo(),
);
}
}
ここ注目ポイント。
return Transform.scale(
scale: animation.value * 50,
child: FlutterLogo(),
);
最後に是非忘れないで~
@override
void dispose() {
// TODO: implement dispose
animationController.dispose();
super.dispose();
}
これなら。
- 心臓が動いているアニメーションができる。