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
Update Visibility docs on maintainSize #64148
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
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.
LGTM
This doesn't completely fixes the issue I opened, it just adds one of the recommendations I gave. There's a also the problem with: /// Maintaining the size when the widget is not [visible] is not notably more
/// expensive than just keeping animations running without maintaining the
/// size, and may in some circumstances be slightly cheaper if the subtree is
/// simple and the [visible] property is frequently toggled, since it avoids
/// triggering a layout change when the [visible] property is toggled. If the
/// [child] subtree is not trivial then it is significantly cheaper to not
/// even keep the state (see [maintainState]). Which goes in depth to explain the costs of maintaining the size, animations and state, but we don't actually have an option (and the text makes it look like we have) as if we select to That's the part that I think needs clarification. It looks like something that was written a while ago, but the Framework evolved and added constraints that the docs don't fit anymore. |
Description
To make the documentation clearer, I added a statement about maintainState
Related Issues
Fixes #53073
Tests
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read [Handling breaking changes].