-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add clipBehavior to Snackbar
#98252
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
Add clipBehavior to Snackbar
#98252
Conversation
bd36fd5 to
2a2a5eb
Compare
clipBehaviour for SnackbarclipBehavior for Snackbar
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
clipBehavior for SnackbarclipBehavior to Snackbar
9c3aa7c to
14c4507
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
11bbc3c to
cd62948
Compare
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. Changes reported for pull request #98252 at sha cd629487561f4da4de6775d277f8a585ac3b806e |
|
So are we adding a clip to all snackbars in case a particular child needs it? Could the responsibility be pushed to the child that actually adds the BackdropFilter? Isn't that a widget that we control? |
|
Hey @flar showSnackbar only takes Snackbar, not Widget such as Snackbar wrapped with ClipRect. While the desired effect is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this was a regression, should we restore the original behavior that clipped, and let those that do not want it to set Clip.none?
I can see folks not wanting a subtle shadow clip, but I can also understand folks that were broken by removing the clip, and in the case of the backdrop filter experiencing a very disruptive change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea, I think restoring original clipping would help most folks. Removing it when needed is easy with PR now :)
29e8f67 to
95cbb65
Compare
|
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. Changes reported for pull request #98252 at sha 95cbb654559d580de9b7eb9433f6363948832b24 |
Piinks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved golden files, LGTM
|
This pull request is not suitable for automatic merging in its current state.
|


regression: #94811
context: #94811 (review)
fixes: #98205
We didn't know why
ClipRectwas present as it wasn't failing any test but looks like it does affectBackdropFilterwhen applied to Snackbar's contentFor regular widgets,
BackdropFiltercould use some clipping thus ClipRect is usually applied, see this #16614 (comment)For Snackbar, it is not possible since you can only provide Snackbar to
showSnackbarfunction and this issue shows when trying to applyBackdropFilterSnackbar's Content to achieve the desired results, blur area is not clipped.So this PR introduces clip behavior, which when not set to
Clip.none, appliesClipRectto the Snackbar itself. This is same asCupertinoFormSectionclipBehavior code.This way clipping is achievable when needed without breaking previous issue or new issue.
minimal code sample
Preview
Golden test
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.