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
Gallery: sometimes, on Android, the word "Demos" is half-way under the app bar on launch #5368
Maybe we don't initialize the padding early enough? I would have expected the layout to update when the padding changes to its final value... Is there a missing dependency with the scaffold's custom layout somehow?
Maybe it is possible for Engine::OnViewportMetricsChanged() to have been called after the scaffold has looked up the window padding as well as not triggering a rebuild?
Note also: So far I haven't been able to reproduce the problem and verify that the source is in fact the window padding being zero. This may all be idle speculation.
When running on the Android emulator and occasionally when running Android native, MediaQuery.of(context).padding.top is zero when it's called at Widget initState() time. Calling it at build() time instead appears to consistently return the status bar's actual height.
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
abarth commentedon Aug 12, 2016
I've seen this too. It appears to be some sort of race condition during startup.
HansMuller commentedon Aug 12, 2016
This looks like a consequence of MediaQuery.of(context).padding.top returning zero
abarth commentedon Aug 12, 2016
Maybe we don't initialize the padding early enough? I would have expected the layout to update when the padding changes to its final value... Is there a missing dependency with the scaffold's custom layout somehow?
abarth commentedon Aug 12, 2016
That looks right...
HansMuller commentedon Aug 12, 2016
Maybe it is possible for Engine::OnViewportMetricsChanged() to have been called after the scaffold has looked up the window padding as well as not triggering a rebuild?
Note also: So far I haven't been able to reproduce the problem and verify that the source is in fact the window padding being zero. This may all be idle speculation.
sethladd commentedon Aug 15, 2016
Another user stopped by my desk today and pointed this out :)
jason-simmons commentedon Aug 18, 2016
I can reproduce this easily on the Android emulator
HansMuller commentedon Aug 18, 2016
Jason and I just sorted this out.
When running on the Android emulator and occasionally when running Android native, MediaQuery.of(context).padding.top is zero when it's called at Widget initState() time. Calling it at build() time instead appears to consistently return the status bar's actual height.
github-actions commentedon Sep 6, 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.