Skip to content

Added Scaffold.extendBodyBehindAppBar - #39156

Merged
HansMuller merged 2 commits into
flutter:masterfrom
HansMuller:extend_scaffold_body_top
Aug 26, 2019
Merged

HansMuller merged 2 commits into
flutter:masterfrom
HansMuller:extend_scaffold_body_top

Conversation

@HansMuller

@HansMuller HansMuller commented Aug 24, 2019 •

Copy link
Copy Markdown
Contributor

Add support for extending the height of the Scaffold's body behind the app bar, to the top of the Scaffold. This is useful when the scaffold's AppBar has a translucent backgroundColor.

Fixes: #17088

A similar PR that addressed the same issue was created by @domesticmouse at about the same time as this one: #39093. I wanted to thank Brett Morgan for rolling with this tragic bit of synchronicity and for reviewing this PR!

Here's a small demo of the feature:

out

@fluttergithubbot fluttergithubbot added p: material_ui material_ui package in flutter/packages framework flutter/packages/flutter repository. See also f: labels. labels Aug 24, 2019
@googlebot

Copy link
Copy Markdown

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

Comment thread packages/flutter/lib/src/material/scaffold.dart Outdated
@domesticmouse

Copy link
Copy Markdown
Contributor

Co-author should be [email protected] =)

@HansMuller

Copy link
Copy Markdown
Contributor Author

I didn't realize that despite being over there, you're from here :-). Will fix up the co-authorage.

@HansMuller
HansMuller force-pushed the extend_scaffold_body_top branch from 46161ad to bbeb5f7 Compare August 24, 2019 01:24
@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@darrenaustin darrenaustin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

const _BodyBuilder({ Key key, this.body }) : super(key: key);
const _BodyBuilder({
Key key,
@required this.extendBody,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With both extendBody and extendBodyBehindAppBar it is a little confusing. Is one is a subset of the other. Perhaps rename extendBody to something like extendBodyBottom to better describe that it is only extending the body on the bottom.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did lament the naming (the evolution of this API) in #17088 (comment)

As you noted below, it's preferable to leave extendBody alone.

///
/// * [extendBodyBehindAppBar], which extends the height of the body
/// to the top of the scaffold.
final bool extendBody;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the name would mean breaking the API. Nevermind :).

@nilsgoksor

Copy link
Copy Markdown

What do I have to do to use this in my project?
"named parameter 'extendBodyBehindAppBar' isn't defined."

@octopurpie

Copy link
Copy Markdown

What do I have to do to use this in my project?
"named parameter 'extendBodyBehindAppBar' isn't defined."

check to dev channel
flutter channel dev
flutter upgrade

@AirborneEagle

Copy link
Copy Markdown

How can I figure which release this was in, or will be in?

@dotcink

dotcink commented Dec 4, 2019

Copy link
Copy Markdown

The current stable version is 1.9.1+hotfix.6.

git tag --contains 35c916 shows that the first tag with this feature is v1.9.7.

Hope it will not take too long.

@dotcink

dotcink commented Dec 12, 2019

Copy link
Copy Markdown

1.12 stable has released with this feature.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting the body behind transparent Appbar

9 participants