animationcontroller status listener flutter code example
Example: animationcontroller status listener flutter
AnimationController _controller;
CurvedAnimation _animation;
@override
void initState() {
super.initState();
_controller = new AnimationController(
duration: const Duration(seconds: 5),
vsync: this,
)..forward();
_animation = new CurvedAnimation(
parent: _controller,
curve: Curves.linear,
)..addStatusListener((AnimationStatus status) {
if (status == AnimationStatus.completed)
print('completed');
});
}