Skip to content

Conversation

@drxddy
Copy link
Contributor

@drxddy drxddy commented Mar 9, 2024

Summary

The current implementation of CupertinoContextMenu, on long press, while animating the child up, it's using a Container Shell in _buildAnimation with a pure White Color (0xFFFFFFFF), instead of being Transparent, this causes white corner borders for those developers that use a higher corner radius in child Widget,

Problem Detail:

When you long press on the Widget after using this CupertinoContextMenu as a parent, it will start animating the child out to occupy half the screen in the top, while this animation happens ( before blur appears on the screen & previewBuilder is rendered), the child is used in a Container with a decoration of pure white color (0xFFFFFFFF), with no border-radius, this will cause inconsistent looks while the child undergoes a transition.

This issue does not exist when using CupertinoContextMenu.builder, this is how CupertinoContextMenu should also be working.

Fixes #144886

Video

Screen.Recording.2024-03-10.at.01.47.03.mov

Pre-launch Checklist

@google-cla
Copy link

google-cla bot commented Mar 9, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Mar 9, 2024
@drxddy drxddy changed the title Remove White Color in Cupertino Context Menu Container to make the Sh… Fix Cupertino Context Menu Container to Remove White Corners Mar 9, 2024
@drxddy drxddy force-pushed the patch-1 branch 2 times, most recently from 661dd08 to e3ab5eb Compare March 10, 2024 03:22
drxddy and others added 4 commits March 12, 2024 00:24
…ell Transparent

The existing version assumes the background is in Pure White (0xFFFFFFFF), and the Container that Shells the child in _buildAnimation should not assume any color.
@justinmc justinmc requested review from MitchellGoodwin and removed request for navaronbracke March 12, 2024 01:24
@drxddy
Copy link
Contributor Author

drxddy commented Mar 12, 2024

Thanks, I agree with you @justinmc, realized a simpler way to test this is by using runtimeType, of _DecoyChild, finding its Descendant Container, and Verifying with its decoration property, after looking at other test examples.

So this latest commit 49ba870 simplifies and undoes a lot of workarounds done in previous commits, and reverts to the old version of the file with just removal of white color in _DecoyChild.

_DecoyChild is kept private now & kept the overall changes minimal, with the changes you suggested in the review.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

One question about other white colors I found in the file. Otherwise I think this looks good, but @MitchellGoodwin should have the final say as to whether that white color was there for a good reason or not.

Copy link
Contributor

@MitchellGoodwin MitchellGoodwin left a comment

Choose a reason for hiding this comment

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

Getting rid of the white color seems to cause no issues. I think it was there from an incorrect assumption that CupertinoContext menu would be used only in a native iOS-like background.

Echoing Justin, it should probably be removed from examples in this file.

@drxddy drxddy changed the title Fix Cupertino Context Menu Container to Remove White Corners Fix Cupertino Context Menu Container Corners Dec 2, 2024
@drxddy drxddy changed the title Fix Cupertino Context Menu Container Corners Fix Cupertino Context Menu Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

White Corners Issue in Cupertino Context Menu

4 participants