SliverAppBar with ShrinkWrap Patch#73195
Conversation
This better emulates the behavior of the standard viewport, which paints its center child and all subsequent children in reverse order. It also fixes a bug causing children of a shrink-wrapping CustomScrollView to paint over a SliverAppBar.
Documentation states that childrenInHitTestOrder should be the reverse of childrenInPaintOrder. Updated to match change to childrenInPaintOrder.
Piinks
left a comment
There was a problem hiding this comment.
Hey @NWalker1208 thanks for the contribution! I am going to run this through additional internal tests first to check for potential breaks.
Piinks
left a comment
There was a problem hiding this comment.
LGTM! Thank you @NWalker1208 for your first contribution!
|
Hey @Piinks! :) |
|
Hi @BazinC I do not know the date that this change will arrive on stable. Our wiki also has some guidance on identifying where a fix is, like this one, so this may be helpful as well: https://github.com/flutter/flutter/wiki/Where%27s-my-Commit%3F |
|
Thanks for your answer @Piinks! |
This better emulates the behavior of the standard Viewport class, which, after painting all children before its center child, paints its center child and all subsequent children in reverse order. This fixes a bug causing children of a shrink-wrapping CustomScrollView to paint over a SliverAppBar.
Description
This PR simply reverses childrenInPaintOrder for the RenderShrinkWrappingViewport class. This solves any issues where slivers in a CustomScrollView would paint over a SliverAppBar whenever the scroll view had shrink-wrapping enabled.
Related Issues
#28197 Resolved by this PR.
#36002 Partly resolved by this PR. I did not modify scrolling behavior.
#52976 Partly resolved by this PR.
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.