Skip to content

Fix decorated box#179802

Merged
auto-submit[bot] merged 2 commits intoflutter:masterfrom
zemanux:fix_decorated_sliver
Feb 4, 2026
Merged

Fix decorated box#179802
auto-submit[bot] merged 2 commits intoflutter:masterfrom
zemanux:fix_decorated_sliver

Conversation

@zemanux
Copy link
Contributor

@zemanux zemanux commented Dec 12, 2025

Fix #179801

RenderSliver.getMaxPaintRect was moved up to RenderSliver as it is also needed for PR #179003, the logic was therefore duplicated here.

(The widget labeled A SliverToBoxAdapter is actually a PinnedHeaderSliver)

decorated_sliver.mp4
decorated_sliver_reverse.mp4

Pre-launch Checklist

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. labels Dec 12, 2025
@zemanux zemanux force-pushed the fix_decorated_sliver branch from 33807d2 to 78f5e1c Compare December 12, 2025 18:08
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the painting logic for RenderDecoratedSliver by introducing a new getMaxPaintRect method in the base RenderSliver class. This is a good simplification that fixes an issue with border painting during scrolling. However, the refactoring appears to have introduced a regression by removing the specific handling for slivers with infinite scroll extents. My review includes critical feedback to address this regression by reintroducing the necessary logic in a way that fits the new structure. I've also included a suggestion to improve a code comment for clarity.

@zemanux zemanux force-pushed the fix_decorated_sliver branch 2 times, most recently from 2630311 to e237889 Compare December 12, 2025 18:20
@zemanux zemanux force-pushed the fix_decorated_sliver branch from e237889 to 7ed012a Compare December 15, 2025 14:40
expect(
find.byKey(key),
paints..rect(
rect: const Offset(0.5, -199.5) & const Size(99, 499),
Copy link
Contributor Author

@zemanux zemanux Dec 15, 2025

Choose a reason for hiding this comment

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

Previous tests show wrong direction. It has been fixed.

@zemanux zemanux force-pushed the fix_decorated_sliver branch from 7ed012a to b1ca6c4 Compare December 15, 2025 16:08
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

RenderSliver.getMaxPaintRect was moved up to RenderSliver

Can you open this as a separate PR? Since both changes need it, it would be good to ensure that sticks first and does not cause any unexpected issues.

Thank you for your contributions! I noticed more than one in my queue 🙂 - they are all truly appreciated. I may not be able to finish reviewing them all before the holidays as I am getting into OOO time. I appreciate your patience, and I hope you have a wonderful holiday!

@zemanux zemanux mentioned this pull request Dec 18, 2025
9 tasks
@zemanux
Copy link
Contributor Author

zemanux commented Dec 18, 2025

@Piinks I've created PR #180074 and rebased this one on it.

Thank you for your contributions! I noticed more than one in my queue 🙂 - they are all truly appreciated. I may not be able to finish reviewing them all before the holidays as I am getting into OOO time. I appreciate your patience, and I hope you have a wonderful holiday!

No worries at all regarding the review time. Have a wonderful holiday too!

@zemanux zemanux force-pushed the fix_decorated_sliver branch from b1ca6c4 to 053e899 Compare December 19, 2025 06:25
@zemanux zemanux force-pushed the fix_decorated_sliver branch 2 times, most recently from ac49b53 to 5532411 Compare December 29, 2025 17:21
@Piinks
Copy link
Contributor

Piinks commented Jan 7, 2026

Thanks for separating out the change to ad the method to RenderSliver. I will hold off on reviewing this and #179003 until the dependent change, #180074, is ready. :)

@zemanux zemanux force-pushed the fix_decorated_sliver branch from 5532411 to f065589 Compare January 8, 2026 12:13
@justinmc justinmc requested a review from Piinks January 20, 2026 23:31
github-merge-queue bot pushed a commit that referenced this pull request Jan 21, 2026
This PR extracts the `getMaxPaintRect` logic into a shared method in
`RenderSliver`. This helper is required for upcoming changes in #179003
and #179802 to avoid code duplication.

Cc @Piinks 

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
@zemanux zemanux force-pushed the fix_decorated_sliver branch from f065589 to 43f0dee Compare January 21, 2026 06:45
@zemanux
Copy link
Contributor Author

zemanux commented Jan 21, 2026

@Piinks, Since PR #180074 was merged, I rebased this one.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

This LGTM, thank you for your patience. 🙏 I was unexpectedly away. I will seek a second reviewer so we can get this in!

@Piinks Piinks force-pushed the fix_decorated_sliver branch from 43f0dee to 810faac Compare February 3, 2026 18:08
@AbdeMohlbi AbdeMohlbi self-requested a review February 3, 2026 18:16
Copy link
Contributor

@AbdeMohlbi AbdeMohlbi left a comment

Choose a reason for hiding this comment

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

LGTM , with one small nit

);
},
);

Copy link
Contributor

Choose a reason for hiding this comment

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

@zemanux can we add // Regression test for https://github.com/flutter/flutter/issues/issueNumber to have the same format across test files , thank u.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

ok let's ship this change then

@AbdeMohlbi AbdeMohlbi added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 3, 2026
@AbdeMohlbi AbdeMohlbi removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 3, 2026
@Piinks
Copy link
Contributor

Piinks commented Feb 3, 2026

Confirmed the Google testing failure is unrelated. Let's do it! :)

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 3, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Feb 3, 2026
Merged via the queue into flutter:master with commit fbad4cc Feb 4, 2026
74 of 75 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 4, 2026
@zemanux zemanux deleted the fix_decorated_sliver branch February 4, 2026 10:47
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 4, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 4, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 5, 2026
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 5, 2026
Roll Flutter from bf701fefec86 to f916dd6887bf (44 revisions)

flutter/flutter@bf701fe...f916dd6

2026-02-05 [email protected] Implement macOS wide gamut (Display P3) support (flutter/flutter#181769)
2026-02-04 [email protected] Roll Skia from d23ecfbfdff9 to 8543ce512d5c (3 revisions) (flutter/flutter#181923)
2026-02-04 [email protected] Roll Dart SDK from 8001c99d952b to 8f778ffd318b (3 revisions) (flutter/flutter#181927)
2026-02-04 [email protected] Re-enable AddressSanitizer on the linux_unopt builder (flutter/flutter#181741)
2026-02-04 [email protected] Add exception to log message in ContentSizingFlag.java (flutter/flutter#181813)
2026-02-04 [email protected] Roll pub packages (flutter/flutter#181925)
2026-02-04 [email protected] [flutter_tools] Deprecate web hot reload flag (flutter/flutter#181884)
2026-02-04 [email protected] Marks platform_views_scroll_perf_impeller__timeline_summary unflaky (flutter/flutter#181649)
2026-02-04 [email protected] Roll Dart SDK from 204db085d970 to 8001c99d952b (1 revision) (flutter/flutter#181902)
2026-02-04 [email protected] Roll Skia from f37a22506eb4 to d23ecfbfdff9 (23 revisions) (flutter/flutter#181915)
2026-02-04 [email protected] In the Web codec tests, skip an undecodable image that is used to test a Skia error handling code path. (flutter/flutter#181870)
2026-02-04 [email protected] Roll Packages from 5b1bea8 to 3bddf2c (5 revisions) (flutter/flutter#181918)
2026-02-04 [email protected] Roll Fuchsia Linux SDK from UmQaaNuhkiuE8Dzug... to J2QdLcY2gyt4NP_xV... (flutter/flutter#181893)
2026-02-04 [email protected] Roll Dart SDK from 54322a0b1109 to 204db085d970 (3 revisions) (flutter/flutter#181890)
2026-02-04 [email protected] Cleanup cross imports (flutter/flutter#181807)
2026-02-04 [email protected] [Material] Remove Material import from backdrop_filter_test.dart widget tests (flutter/flutter#181386)
2026-02-04 [email protected] Move CheckedModeBanner tests to material and remove Material import from widgets banner_test (flutter/flutter#181261)
2026-02-04 [email protected] feat: Pass parameters from DropdownMenuFormField to DropDownMenu (flutter/flutter#181373)
2026-02-04 [email protected] Remove `Config complete` log when using `flutter build apk --config-only` (flutter/flutter#181864)
2026-02-04 [email protected] [Impeller] Fix flattening of very large zoomed curves with tiny stroke widths (flutter/flutter#181505)
2026-02-03 [email protected] Propagates Overlay's MediaQueryData to OverlayPortal child (flutter/flutter#181579)
2026-02-03 [email protected] Make sure that an AnimatedScale doesn't crash in 0x0 environment (flutter/flutter#181481)
2026-02-03 [email protected] Roll Dart SDK from 56294a92d5cc to 54322a0b1109 (1 revision) (flutter/flutter#181872)
2026-02-03 [email protected] Fix decorated box (flutter/flutter#179802)
2026-02-03 [email protected] Roll pub packages (flutter/flutter#181871)
2026-02-03 [email protected] Remove Material library dependency from expansible_test.dart (flutter/flutter#181657)
2026-02-03 [email protected] Organize and update fragment shader uniform tests. (flutter/flutter#181822)
2026-02-03 [email protected] fix(web_ui): handle non-invertible matrices in ImageFilter.matrix (flutter/flutter#181742)
2026-02-03 [email protected] Remove unnecessary Material import from cupertino/slider_test.dart (flutter/flutter#180957)
2026-02-03 [email protected] Remove the Flutter.xcframework as a swift dependency (flutter/flutter#181739)
2026-02-03 [email protected] feature: implementation of tooltips in the `_TestWindowingOwner` and minor bugfixes to the multiple windows example app (flutter/flutter#181510)
2026-02-03 [email protected] [Web] Fix flt-platform-view comment (flutter/flutter#181576)
2026-02-03 [email protected] Marks Linux_pixel_7pro android_verified_input_test to be unflaky (flutter/flutter#179120)
2026-02-03 [email protected] Unmark `hybrid_android_views_integration_test` as bringup (flutter/flutter#181628)
2026-02-03 [email protected] Remove material from sliver_tree_test.dart (flutter/flutter#181415)
2026-02-03 [email protected] Make `android_plugin_new_output_dir_test` only build release (flutter/flutter#181677)
2026-02-03 [email protected] Roll customer tests (flutter/flutter#181825)
2026-02-03 [email protected] Add Linux Foundation Health Score badge to README (flutter/flutter#175587)
2026-02-03 [email protected] Remove unused getters on AndroidProject class (flutter/flutter#181860)
2026-02-03 [email protected] Adds batch release doc for flutter/package (flutter/flutter#181676)
2026-02-03 [email protected] [ Tool ] Don't use `globals.platform` in `getFlutterRoot()` (flutter/flutter#181859)
2026-02-03 [email protected] Roll Packages from 837dbbd to 5b1bea8 (10 revisions) (flutter/flutter#181857)
2026-02-03 [email protected] Remove material from basic_test.dart (flutter/flutter#181444)
2026-02-03 [email protected] [ Tool ] Fix regression introduced in flutter/flutter#181421 (flutter/flutter#181826)

If this roll has caused a breakage, revert this CL and stop the roller
...
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Feb 6, 2026
Fix flutter#179801

`RenderSliver.getMaxPaintRect` was moved up to `RenderSliver` as it is
also needed for PR flutter#179003, the logic was therefore duplicated here.

(The widget labeled `A SliverToBoxAdapter` is actually a
`PinnedHeaderSliver`)


https://github.com/user-attachments/assets/c94b25a2-c156-4d77-a5ed-3059a91044b3


https://github.com/user-attachments/assets/815fa522-1144-4a61-aab8-488942d4a50e


## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
This PR extracts the `getMaxPaintRect` logic into a shared method in
`RenderSliver`. This helper is required for upcoming changes in flutter#179003
and flutter#179802 to avoid code duplication.

Cc @Piinks 

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
Fix flutter#179801

`RenderSliver.getMaxPaintRect` was moved up to `RenderSliver` as it is
also needed for PR flutter#179003, the logic was therefore duplicated here.

(The widget labeled `A SliverToBoxAdapter` is actually a
`PinnedHeaderSliver`)


https://github.com/user-attachments/assets/c94b25a2-c156-4d77-a5ed-3059a91044b3


https://github.com/user-attachments/assets/815fa522-1144-4a61-aab8-488942d4a50e


## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
Fix flutter#179801

`RenderSliver.getMaxPaintRect` was moved up to `RenderSliver` as it is
also needed for PR flutter#179003, the logic was therefore duplicated here.

(The widget labeled `A SliverToBoxAdapter` is actually a
`PinnedHeaderSliver`)


https://github.com/user-attachments/assets/c94b25a2-c156-4d77-a5ed-3059a91044b3


https://github.com/user-attachments/assets/815fa522-1144-4a61-aab8-488942d4a50e


## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

Development

Successfully merging this pull request may close these issues.

DecoratedSliver inconsistency with pinned header or reversed Scrollable

3 participants