flutter_animate icon indicating copy to clipboard operation
flutter_animate copied to clipboard

Stagger Animation doesn't play correctly on second trigger

Open Icaroto opened this issue 1 year ago • 0 comments

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?

Icaroto avatar Dec 05 '24 18:12 Icaroto