Open princesanjivy opened 1 year ago
Have you tried putting a Key onto the child widgets of the WidgetAnimator
such as PlayerCard
?
The class works similar to AnimatedSwitcher
so it'll only detect changes to the child if the child is either of a different type (e.g. one is Text
and one is Container
) or if the key of the widget changes
I also encountered the same problem. The state of the Text
wrapped by WidgetAnimator
will not be refreshed.
@andrewpmoore
@giantss I think at the moment it won't refresh the lower level widgets unless the key has changed on the child of the WidgetAnimator
as it won't know there's been a change otherwise. It's something when I get some free time I'd like to look into trying to improve
@andrewpmoore
Okay, sorry to trouble you, waiting for the update.
This time the plugin is great.
At present, I can only set WidgetAnimator
to UniqueKey
to deal with it temporarily, but this will have a certain impact on performance.
@andrewpmoore
Hello, is there still time to fix this problem?
I use this plug-in in more and more places in my projects, and most of them are used in lists. If I keep using UniqueKey
to solve the refresh problem, I am worried that there will be big problems in performance.
I also discovered a situation today. If you use WidgetAnimator as part of the list and click the component wrapped by WidgetAnimator to enter the next interface after the list is refreshed, the parameters passed in have changed, but the actual data is still the old data.
Currently I still use key UniqueKey to solve this problem. Can this issue be fixed soon?
In the below,
Row
widget I've my custom widgets each have their ownWidgetAnimator
and the values used in each of them will be changed over a button press from another widget'sonPressed
call where I have placed thesetState(() {});
. Basically, the issue is state is not getting updated across these separate widgets. When I everything under oneWidgetAnimator
state gets changed but I don't that behaviour.Also, I tried of using
Provider
package, wrapping up each of these withConsumer
by, this method it's working but the code looks complicated and I believe there must be some other workaround for usingsetState
.Please let me know if you need entire page source for debugging this. BTW, this is an awesome package 🎉
Thanks, any help will be appreciated.