Skip to content

Stop recommending "shrinkWrap" #104008

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

Merged
merged 1 commit into from
May 19, 2022
Merged

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented May 17, 2022

Fixes #103085

Using a ShrinkWrapping viewport is pretty much never the right thing to do in the case of this error. It introduces a much more expensive widget to the tree than a Column, Row, or Wrap would be, and the real solution if you can't use those is to use a CustomScrollView instead to arrange your slivers.

One of the main problems introduced by this pattern is that it breaks up a scrollable into many more repaint boundaries than necessary, which makes painting/compositing/rasterization less efficient later in most cases.

@dnfield dnfield requested review from goderbauer and Piinks May 17, 2022 20:37
@flutter-dashboard flutter-dashboard bot added f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels May 17, 2022
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM!!

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.

L-so-GTM! Thanks!

@goderbauer
Copy link
Member

(from triage) @dnfield Looks like the google check got stuck on this one...

@dnfield
Copy link
Contributor Author

dnfield commented May 18, 2022

I've manually marked the status as clean, this can't actually be causing failures...

@fluttergithubbot fluttergithubbot merged commit d50b5a0 into flutter:master May 19, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 19, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 19, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 19, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 21, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 30, 2022
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
None yet
Development

Successfully merging this pull request may close these issues.

Stop recommending shrink wrapping in assertion messages
4 participants