-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Update Gallery usage of Scaffold.of #6639
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
Update Gallery usage of Scaffold.of #6639
Conversation
/cc @Hixie |
@HansMuller are you expecting this to return null? Ideally we'd have a test for this too... |
The existing The Scaffold.of() call is within a Builder widget that only exists so that the Scaffold.of() call will succeed. |
So it should not be returning null? It apparently is... |
The problem appears to be the Scaffold's key: I don't think there's any need for |
I'm still seeing Scaffold.of() returning null after removing the _homeKey |
Yes, sorry about the misdirection. Although the problem seemed to have gone away after removing _homeKey (which I still don't think is needed), trying the remedy again fails for me too. |
Scaffold.of() seems to be returning null due to some sort of race involving the hero animation subsystem. If the Builder within Gallery's AppBar is invoked while the animation is still in progress, then the AppBar widgets will be descendants of the HeroQuestState transition widgets and will not have a Scaffold ancestor. |
Oh, that makes sense. During the page transition, the AppBar is a hero that persists during the transition. When it is transitioning, it isn't a child of the scaffold. |
9a85987
to
44deca1
Compare
Changed this to use a GlobalKey to locate the scaffold PTAL |
LGTM! |
Ideally this would have a test -- in fact I'm surprised the smoketest didn't catch this. |
No description provided.