-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Add collapsed height param to SliverAppBar #58593
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
Add collapsed height param to SliverAppBar #58593
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
thanks for this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change. I've done a little more wordsmithing. LGTM
…floating, pinned, with bottom widget set.
// 1 | 1 | 1 || fade | ||
final double toolbarOpacity = !pinned || (floating && bottom != null) | ||
? ((visibleMainHeight - _bottomHeight) / kToolbarHeight).clamp(0.0, 1.0) as double | ||
final bool isPinnedWithOpacityFade = pinned && floating && bottom != null && extraToolbarHeight == 0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE, I think this is easier to read then the original truth table.
Description
Add the
collapsedHeight
param to theSliverAppBar
, allowing for users to set the minimum height when it is collapsed.SliverAppBar
withcollapsedHeight
set:Floating

SliverAppBar
withcollapsedHeight
set:SliverAppBar
that is floating, pinned, has a bottom widget, withcollapsedHeight
andexpandedHeight
set:Related Issues
Closes #21298
Tests
I added the following tests:
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.