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

Fix: DelegateTransition for cupertino sheet route #164675

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rkishan516
Copy link
Contributor

@rkishan516 rkishan516 commented Mar 6, 2025

Fix: DelegateTransition for cupertino sheet route
fixes: #163954

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].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Mar 6, 2025
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.

I'll defer to @MitchellGoodwin on this. I think this probably needs a new test that covers this case at least though.

Comment on lines -813 to +815
final Rect clipRect = tester.getRect(clipRRectFinder);
expect(clipRect.center, equals(const Offset(400, 300)));
expect(clipRRectFinder, findsNothing);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did this change exactly?

Ideally it would be nice if you could write a test that reproduces the error in #163954 and expect that it doesn't happen anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since after popping this clipper doesn't exist anymore, that's why added this.
But yeah, it will make more sense to add another test which replicates error in #163954

Comment on lines +260 to +262
if (child != null && secondaryAnimation.isDismissed) {
return child;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain why this fixes the bug for my own understanding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After coming back from sheet, if it shows SlideTransition which internally uses RenderFractionalTranslation which doesn't have size because its just a proxy box. So, throws the error as seen in #163954.

Also, it makes sense to just return page, when we have fully popped of from sheet.

@rkishan516 rkishan516 force-pushed the cupertino-sheet-route-popup branch from 2b7c256 to 35e0e3c Compare March 22, 2025 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

CupertinoSheetRoute causes error when opening PopupMenuButton after closing the route
2 participants