-
Notifications
You must be signed in to change notification settings - Fork 548
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
Flutter Update: 2.10.0 - Fix: Looking up a deactivated widget's ancestor is unsafe fix #499
Flutter Update: 2.10.0 - Fix: Looking up a deactivated widget's ancestor is unsafe fix #499
Conversation
@renancaraujo could you update package on pub.dev? |
Will this be published to pub.dev anytime soon? |
I also need a new fix |
Please upload new update for this package on pub.dev |
It's not related to 2.10.0 and the fix is only partial I'm afraid. This should work on all situations :
edit : maybe the didChange is not mandatory. So it just add the missing _rotationAnimationController. |
@bounty1342 Thank you ,It works fine 👍 |
@bounty1342 would you mind open a PR for a proper fix? |
@bounty1342 in which file do we need to apply these changes? could you please suggest me? my code are attached here and I am receiving same error. |
The suggested change of @bounty1342 is looking interesting. If you don't want to get the exception and you are willing to use the master branch, then you could change your dependency in photo_view:
git: https://github.com/bluefireteam/photo_view.git |
@karvulf , yep there is no need for didChangeDependencies, I was thinking about didUpdateWidget... We should override didUpdateWidget() and recreate the controller if the controller change, this way we could reuse the same widget with the new controller. (We need to create new controller as there is no way to update the initial scale for exemple) What do you think ? |
Well, I didn't look any deeper inside the code, but normally I wouldn't recreate the controller, but it depends on the usecase, I think. |
And if there was a problem with an intial value, then the bug should already exists because the creation of the controller didn't changed. It was just moved to |
FYI, my encounter with the problem was that if you don't touch anything and navigate away from |
Just use latest version from github and your issue will be solved
…On Fri, Feb 11, 2022, 9:10 PM Harry Dickson ***@***.***> wrote:
FYI, my encounter with the problem was that if you don't touch anything
and navigate away from PhotoView, causing PhotoViewCoreState.dispose() to
be called, it *lazily* instantiates the controllers in dispose() (they
are late final) just to immediately dispose of them. And this causes pain
and confusion to the confused dev (me)
—
Reply to this email directly, view it on GitHub
<#499 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALWDD3OXAGUEBHHZRNIJ6KDU2UUWXANCNFSM5NRMYFLA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Please release this fix! :) |
Anything holding this from a release? @karvulf |
No I don't think so, but I am not able to update this on pub.dev @matehat |
I am also voting for a release. |
vote too for an official release! thanks a lot! |
Is there any planned date to release this fix? |
…tor is unsafe fix (bluefireteam#499) * Looking up a deactivated widget's ancestor is unsafe fix * fixed assignment Co-authored-by: André <andre.boerger@alte-leipziger.de>
…tor is unsafe fix (bluefireteam#499) * Looking up a deactivated widget's ancestor is unsafe fix * fixed assignment Co-authored-by: André <andre.boerger@alte-leipziger.de>
Is there any release date, please? We are really needing this |
Guys, WTF? With all due respect, the solution to this problem has been waiting for more than two months. Maybe it's just that we're doing something wrong, which is why we get an error? Please give a comment. |
any release date for this fix? its Flutter 3 now |
Is the owner still active anywhere? Maybe it's time for a fork? |
I still have the issue.. is there any other solution to solve this issue? |
0.14.0 is out! |
With the new stable version
2.10.0
of Flutter, there is a new problem.When building this widget with some images, it works fine.
But when leaving/disposing this widget, there is crash report in the console that says
Looking up a deactivated widget's ancestor is unsafe
.The solution for this problem was to initialize the controller inside
initState
to ensure, that everything was initialized correctly in the lifecycle of a stateful widget.When the widget is disposed, there is no problem disposing these controllers.