Skip to content
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

Nested Scaffolds redundantly move contents up when there's a keyboard #7036

Closed
Hixie opened this issue Nov 28, 2016 · 14 comments
Closed

Nested Scaffolds redundantly move contents up when there's a keyboard #7036

Hixie opened this issue Nov 28, 2016 · 14 comments

Comments

@Hixie
Copy link
Contributor

Hixie commented Nov 28, 2016

Scaffolds indiscriminately apply the MediaQuery.of(context).padding, so if you nest them they double up on trying to get out of the way of keyboards.

They should probably put a MediaQuery around their body themselves that removes the padding that they handle.

(A workaround in the meantime is to tell your inner scaffold not to resizeToAvoidBottomPadding.)

@abarth
Copy link
Contributor

abarth commented Nov 28, 2016

Yeah, we need to consume the padding in the scaffold.

@Hixie
Copy link
Contributor Author

Hixie commented Feb 27, 2017

Probably we should also make sure we handle the status bar.

@Hixie Hixie added this to the 5: Make Hixie proud milestone Feb 27, 2017
@Hixie Hixie added the easy fix label Feb 27, 2017
@Hixie
Copy link
Contributor Author

Hixie commented Jan 15, 2018

cc @cbracken I think we did this, right?

@Hixie Hixie closed this as completed Jan 15, 2018
@Heasummn
Copy link

Running Flutter 1.0.0 and SDK 28.0.3, I still see this bug. Using resizeToAvoidBottomPadding on the inner scaffold fixes the problem, but I feel as if there is a better way to do this.

@zoechi
Copy link
Contributor

zoechi commented Dec 31, 2018

@Heasummn is there a specific reason you need to nest Scaffold? Scaffold is not designed to be nested.

@Heasummn
Copy link

I have repeated logic/ui that uses a FAB and general content, but I would like the App Bar to be seperate from that logic. If there's another way to get a FAB without a scaffold, I would definitely use that instead.

@zoechi
Copy link
Contributor

zoechi commented Dec 31, 2018

@Heasummn I'd suggest to ask support questions in one of the other channels listed at http://flutter.io/support .

@aryzhov
Copy link
Contributor

aryzhov commented Jan 21, 2019

Nested scaffolds are necessary. Consider an app that has a bottom navigation bar, and each tab has has a different app bar (with different actions, for example). An example is described in detail in this blog article.

@aryzhov
Copy link
Contributor

aryzhov commented Jan 21, 2019

Perhaps the whole concept of a scaffold is broken, as this widget tries to do too many things: managing model popups, involved in navigation, etc. If nested scaffolds are not possible, we need Scaffold to be composed of multiple, reusable widgets.

@zoechi
Copy link
Contributor

zoechi commented Jan 21, 2019

@aryzhov that was changed recently to make nested Scaffolds work. Try dev or master channel.

@zoechi
Copy link
Contributor

zoechi commented Jan 21, 2019

@aryzhov feel free to build your own widget that does exactly what you need instead of using provided ones.

@zoechi
Copy link
Contributor

zoechi commented Jan 24, 2019

See also #26259

@aryzhov
Copy link
Contributor

aryzhov commented Feb 12, 2019

As of 1.1.8, nested scaffolds appear to be working but resizeToAvoidBottomPadding: false is still necessary for the outer Scaffold.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants