Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make _layoutBoundary a boolean 2 #169958

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

Merged
merged 10 commits into from
Jun 4, 2025

Conversation

LongCatIsLooong
Copy link
Contributor

#169638, without the more risky changes. I'll try to fix the g3 failures and land #169638 later.

Pre-launch Checklist

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

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jun 3, 2025
@LongCatIsLooong LongCatIsLooong requested a review from chunhtai June 4, 2025 17:35
@LongCatIsLooong LongCatIsLooong marked this pull request as ready for review June 4, 2025 17:35
assert(() {
_debugCanParentUseSize = parentUsesSize;
return true;
}());

_isRelayoutBoundary = !parentUsesSize || sizedByParent || constraints.isTight || parent == null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uhm it looks like before this patch if !_needsLayout && constraints == _constraints is true the RenderObject can have a null _relayoutBoundary even after layout.

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

LGTM

}
if (_relayoutBoundary != this) {
_needsLayout = true;
if (owner case final PipelineOwner owner? when (_isRelayoutBoundary ?? false)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding, promote owner to non-null when _isRelayoutBoundary is true

what does the question make after the owner in case final PipelineOwner owner? do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://dart.dev/language/pattern-types#null-check

It's currently optional with the flutter/flutter repo enforcing type annotations everywhere, but I thought this was a good practice in case that changes (in which case it would become if (owner case final owner? when ...).

On a related note, I think putting type annotations everywhere is actually pretty awkward here. If the reader doesn't know the exact type of this.owner they might think this line is trying to downcast this.owner from a supertype of PipelineOwner? to PipelineOwner?. With if (owner case final owner?) it's pretty clear that I'm just trying to check for null.

@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 4, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jun 4, 2025
Merged via the queue into flutter:master with commit d3e8dc3 Jun 4, 2025
76 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 4, 2025
@LongCatIsLooong LongCatIsLooong deleted the layout-boundary-boolean-2 branch June 4, 2025 21:30
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.