You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document that Hero needs everything present and ready on frame zero of the transition animation #15586
When navigating from a list view which displays the below CollectionPhoto to the CollectionDetails screen, the Hero animation is not shown. However, when I press the back button from the CollectionDetails page, the animation shows the image moving back into the list.
For a Hero animation to trigger, the Hero has to exist on the very first frame of the new page's animation. In this case, since you are using a StreamBuilder, the first frame will only show "Loading...", and therefore there's no hero to animate.
We should definitely make the documentation better.
Reacted by Mariano Argañaraz, Rohan Taneja and Bartek Pacia
changed the title [-]Hero not animating with Network Image[/-][+]Document that Hero needs everything present and ready on frame zero of the transition animation[/+]on Jun 12, 2018
Is there a good workaround for this limitation? I have a similar situation with the exception that my stream data is from a local source (I'm using the BLoC pattern to manage state) so there is no network delay and thus basically no need for any kind of loading screen.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Hixie commentedon Jun 12, 2018
For a Hero animation to trigger, the Hero has to exist on the very first frame of the new page's animation. In this case, since you are using a StreamBuilder, the first frame will only show "Loading...", and therefore there's no hero to animate.
We should definitely make the documentation better.
[-]Hero not animating with Network Image[/-][+]Document that Hero needs everything present and ready on frame zero of the transition animation[/+]apaatsio commentedon Sep 26, 2018
Is there a good workaround for this limitation? I have a similar situation with the exception that my stream data is from a local source (I'm using the BLoC pattern to manage state) so there is no network delay and thus basically no need for any kind of loading screen.
A simplified version of the destination widget:
Edit: I found a solution for my specific problem. Just have a synchronous getter for the data in the bloc and pass that as
initialDatafor theStreamBuilderlike described here: https://medium.com/@artemsidorenko/bloc-architecture-in-flutter-a-modern-architectural-approach-and-how-we-use-it-at-jimdo-bea143b56d01github-actions commentedon Aug 15, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.