flutter_animate
flutter_animate copied to clipboard
Stagger Animation doesn't play correctly on second trigger
Im creating around 7 buttons in a loop with the following animation:
.animate(
target: isOpened ? 1 : 0,
delay: Duration(milliseconds: (i * 500)),
)
.scaleXY(
delay: Duration(milliseconds: (i * 500)),
duration: Duration(milliseconds: (200)),
)
When I press the button that changes the state of isOpened, the animation starts well, each buttons shows up in order based on the delay. When I press again (isOpened = 0), they are gone all at the same time . Now, when I press one more time (isOpened = 1), apart from the first button which appears first, all the others shows up at the same time right after. Am I missing something?
Is there a proper way to reset this animation or even control them?