So, what i want to achieve it one AnimationController with multiple animation, and i want to reverse specific animation in that controller, right now i am using multiple controller each as parent of single animation
Code :
late final AnimationController controllerHeightCard,
controllerHeightNativeView, controllerInsertingView;
void heightAnimation1() {
controllerHeightCard = AnimationController(
duration: const Duration(milliseconds: 250), vsync: this);
controllerInsertingView = AnimationController(
duration: const Duration(milliseconds: 250), vsync: this);
heightAnimation_1 =
Tween(begin: 310.0, end: 380.0).animate(controllerHeightCard);
heightAnimation_1.addListener(() {
cardHeight.value = heightAnimation_1.value;
});
heightAnimation_2 =
Tween(begin: 0.0, end: 75.0).animate(controllerHeightNativeView);
heightAnimation_2.addListener(() {
containerHeight.value = heightAnimation_2.value;
});
controllerHeightCard.addListener(() {
if (controllerHeightCard.isCompleted && isSignUp.value) {
controllerHeightNativeView.forward();
}
});
controllerHeightNativeView.addStatusListener((status) {
if (controllerHeightNativeView.isDismissed && isSignUp.value == false) {
controllerHeightCard.reverse();
}
});
}
heightAnimationForward() {
isSignUp.value = !isSignUp.value;
if (isSignUp.value == true) {
controllerHeightCard.forward();
}
if (isSignUp.value == false) {
controllerHeightNativeView.reverse(from: 0.1);
}
}
how do i achieve that !!
PS : I am beginner in flutter, sorry for the trash code