Is it good practice in flutter to reset an animation with a Future.delayed?

Viewed 128

I have an AnimatedCrossfade in a StatefulWidget. The crossFadeState is depending on a variable which comes as a return value from another page.

When the variable has a certain value, the firstChild is shown, otherwise the secondChild, - nothing special so far..

After a Future.delayed I reset this variable and the firstChild is shown again via setState.

Is this a good flutter practice?

1 Answers

Try reading "Tween animation" I guess that will answer your question because in every moving animation, you want to reset it so that the starting value of the animation begin at 0 again until it reach the end value. And it will repeat the process over and over again

Related