Skip to content

Do not update a scaffold's AppBar scroll offset if the drawer is open - #5343

Merged
jason-simmons merged 1 commit into
flutter:masterfrom
jason-simmons:bug_5131
Aug 11, 2016
Merged

jason-simmons merged 1 commit into
flutter:masterfrom
jason-simmons:bug_5131

Conversation

@jason-simmons

Copy link
Copy Markdown
Member

Fixes #5131

@dragostis

Copy link
Copy Markdown
Contributor

LGTM.

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.

if (_drawerKey.currentState == null || _drawerKey.currentState.isOpen)

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.

_drawerKey.currentState?.isOpen ?? true should also work.

@HansMuller

Copy link
Copy Markdown
Contributor

I'm not sure that this the right fix. The source of the problem is the lack of a scrollableKey for the Scaffold. Without that key, any scrollable that ends up on top of the appbar will generate scroll notifications that propel the appbar's animation.

We could avoid this problem and some similar ones by putting the scroll notification listener around the scaffold's body, instead of being effectively around the entire scaffold.

@jason-simmons

Copy link
Copy Markdown
Member Author

Moved the scroll notification listener to the body widget.

PTAL

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.

This line could be in the if above.

@dragostis

Copy link
Copy Markdown
Contributor

You should probably reword the commit message. LGTM.

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.

Did you mean to add a blank line here?

@HansMuller

Copy link
Copy Markdown
Contributor

LGTM with a test.

@jason-simmons
jason-simmons force-pushed the bug_5131 branch 2 times, most recently from 0b7be21 to 87297f7 Compare August 11, 2016 23:29
@jason-simmons

Copy link
Copy Markdown
Member Author

Added a test

@HansMuller

Copy link
Copy Markdown
Contributor

It would be useful to put a pointer to the issue in the test, since it's a regression test.

LGTM

@jason-simmons
jason-simmons merged commit 529c25c into flutter:master Aug 11, 2016
@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

Successfully merging this pull request may close these issues.

Gallery, Landscape: Scrolling drawer also scrolls background

3 participants