Skip to content

Allow Clip.none as a valid clipBehavior#95593

Merged
Piinks merged 3 commits intoflutter:masterfrom
Piinks:clipNone
Feb 2, 2022
Merged

Allow Clip.none as a valid clipBehavior#95593
Piinks merged 3 commits intoflutter:masterfrom
Piinks:clipNone

Conversation

@Piinks
Copy link
Contributor

@Piinks Piinks commented Dec 20, 2021

Reference internal bug: b/210103825

This makes it valid to use Clip.none as a clipBehavior, resulting in no clipping.
In cases where clipping is desired conditionally, if you were to add a clipping widget to the tree, and then remove it, Flutter is unable to preserve state in the subtree because the widget types won't match. This has become apparent in the stretching overscroll indicator where such conditional clipping is occurring.

Follow-up change should update the overscroll indicator to prevent state deactivation here:

if (stretch != 0.0 && viewportDimension != mainAxisSize) {

Pre-launch Checklist

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

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Dec 20, 2021
@Piinks Piinks changed the title [WIP] Allow Clip.none Allow Clip.none as a valid behavior Jan 5, 2022
@Piinks Piinks changed the title Allow Clip.none as a valid behavior Allow Clip.none as a valid clipBehavior Jan 5, 2022
@Piinks Piinks marked this pull request as ready for review January 5, 2022 22:03
@Piinks Piinks requested a review from goderbauer January 5, 2022 22:03
@Piinks Piinks requested a review from goderbauer January 26, 2022 23:56
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

@Piinks Piinks added a: layout SystemChrome and Framework's Layout Issues waiting for tree to go green labels Feb 2, 2022
@Piinks Piinks merged commit 13f106b into flutter:master Feb 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 4, 2022
clocksmith pushed a commit to clocksmith/flutter that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: layout SystemChrome and Framework's Layout Issues framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants