-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Hero animation jumps when transitioning between Images with different fit #20510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm also experience this. Would love to see this fixed. |
When hero pop from |
@LongCatIsLooong Any progress about this issue? |
This is by design. according to document https://api.flutter.dev/flutter/widgets/Hero-class.html
The identical also include the attribute which the box fit. I can update the document if it is confusing. The hero animation only change the parent box size and offset, it has no idea about how children render inside the box, and that is why we encourage to keep the child the same. If this is not possible, you should build your own flightShuttleBuilder. For your example
There is no plan to change the current behavior. Let me know if there is other use case that cannot be achieve by using flightShuttleBuilder. |
I will close this issue for now, feel free to reopen if this is still an issue |
Thanks @chunhtai! I did not know about |
The |
can you fix this problem? |
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 |
Hero animations have a sudden jump when animating an image with two different
fit
values. It is very possible that Hero animations are not intended to work in this scenario. If that is the case, the documentation should clarify this. The example in the documentation says the following about fit.This implies that the
BoxFit
does not have to be the same on each image.Steps to Reproduce
Below is an application that demonstrates the issue. This application is a modified version on the application from the docs. In this application, the animation from screen 1 to screen 2 has a noticeable jump as the fit changes. However, the animation from screen 2 back to screen 1 animates perfectly.
GIF:
Url to GIF: https://user-images.githubusercontent.com/20613561/44007746-de559400-9e68-11e8-83ad-88f0fcd72bc3.gif
The text was updated successfully, but these errors were encountered: