I am making a stepper widget and I have been able to make all parts of it, however I plan on updating a state value from my provider after the animation runs, this has not been possible because whenever I make my provider state update, the initState method is run which in turn resets my animation.
This is the content of my initState() method:

And this is how I begin the animation
Everything works fine but whenever the AnimationStatus is completed and I try to make the provider state update, the animation.value value goes back to the initial value and I can see initState being called again.
If I remove the call to notifyListeners() from my provider's setter, then the animation value doesn't get reset, however I need the new value to be updated.
How can I retain this value after the provider state update?
This is a link to my question on stackoverflow: https://stackoverflow.com/questions/64698468/flutter-animation-value-resetting-on-provider-state-update
I am making a stepper widget and I have been able to make all parts of it, however I plan on updating a state value from my provider after the animation runs, this has not been possible because whenever I make my provider state update, the initState method is run which in turn resets my animation.
This is the content of my initState() method:
<Screenshot 2020-11-05 at 14.59.52.png>
And this is how I begin the animation
<Screenshot 2020-11-05 at 15.00.00.png>
Everything works fine but whenever the AnimationStatus is completed and I try to make the provider state update, the animation.value value goes back to the initial value and I can see initState being called again.
If I remove the call to notifyListeners() from my provider's setter, then the animation value doesn't get reset, however I need the new value to be updated.
How can I retain this value after the provider state update?
This is a link to my question on stackoverflow: https://stackoverflow.com/questions/64698468/flutter-animation-value-resetting-on-provider-state-update
--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/9db16750-ab7a-4a01-8579-270d992ae8afn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/7ac35aca-c7b0-49da-adc2-3464bb1158b9n%40googlegroups.com.