Skip to content
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

Allow Clip.none as a valid clipBehavior #95593

Merged
merged 3 commits into from Feb 2, 2022
Merged

Allow Clip.none as a valid clipBehavior #95593

merged 3 commits into from Feb 2, 2022

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.

@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 Jan 5, 2022
@Piinks Piinks requested a review from goderbauer Jan 5, 2022
packages/flutter/lib/src/rendering/layer.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/rendering/proxy_box.dart Outdated Show resolved Hide resolved
@Piinks Piinks requested a review from goderbauer Jan 26, 2022
Copy link
Member

@goderbauer goderbauer left a comment

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants