Closed GouravShDev closed 1 year ago
Hi @GouravShDev, your solution seems to work fine.
Therefore, I see a few possible improvements.
This can be fixed with the property alignment: Alignment.topCenter,
on the AnimatedSize
widget.
should be disabled when description is expanded
As you mentioned, using setState
triggers a widget rebuild, which is perfectly normal.
You can get a working animation with that solution (see solution proposal ⬇️).
Here is a working implementation with the few improvements mentioned. (I didn't know how to share that improvement proposal, so I created a temporary PR)
https://github.com/amugofjava/anytime_podcast_player/pull/85/files
https://user-images.githubusercontent.com/375723/219939418-6a5a9ec1-78d8-4aab-b537-a290a4aaecd4.mp4
I'll push another commit with proposed changes.
This is great, but I wonder if it is possible for the text to be part of the closing animation rather than jumping. If you look at the animation below, which is slowed down, you can see when the description is collapsed the text disappears and then the animation starts. Compare that with the list tile and you can see the text is part of the animation.
This is a definite improvement so I am happy to accept this and the animation could always be improved at a later date.
@amugofjava, Ok I understand what you trying to say. For now, if you want you can accept this merge. I'll work on the improvement in text animation after some time and add another PR.
Thank you for your input on this issue.
Hopefully close #47 I have used StreamController to trigger animation instead of SetState() because the parent widget was rebuilding the whole description Text widget instead of animating. I am open to suggestions if there is a better way to achieve this. Though I think this one isn't bad either.