-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Expose TextHeightBehavior in Text, RichText, and DefaultTextStyle. #48346
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. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Tests will fail until manual roll of engine with engine-side landed. |
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 👍
@@ -17,7 +17,7 @@ | |||
/// painting boxes. | |||
library painting; | |||
|
|||
export 'dart:ui' show Shadow, PlaceholderAlignment; | |||
export 'dart:ui' show Shadow, PlaceholderAlignment, TextHeightBehavior; |
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 think you meant to remove TextHeightBehavior
here.
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 am trying to expose this as part of the painting library so that users do not have to import dart:ui to use this. Does that make sense?
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.
Oh right sorry, I see. I guess I don't see why not 👍
In manual roll process. Engine autoroller is stopped until this lands. |
@GaryQian - CI is still failing on this PR because it's missing some changes in tests that assert on I'm going to revert the upstream change in the engine and re-enable the roller - autorollers are getting behind and it's an issue for the Skia team. |
Also, I'm pretty sure this will have to count as a breaking change... Not sure how we count things like |
The golden failure is a new golden test. The toString test failure was a typo on my part, these particular tests for web don't run on engine until we roll into framework. |
e548dfe
to
f735a0a
Compare
Will let #49742 land first, which will remove need for an engine roll to be in the PR. |
Just received a crash from then when I removed textHeightBehavior property from a Text widget and performed a hot-reload.
Checked the source and you have a assertion for null in the setter in TextPaitner, even though null in is a perfectly valid value for this variable. In fact the constructors default value is to have this variable null. |
Thanks for the catch, let me see if I can get this sorted quickly! |
I just posted a quick PR to fix this. Thanks for bringing this to my attention! #50603 |
Hey, I don't see this property in any theme. Are we expected to add it to every Text widget? |
It should be set in DefaultTextStyle. |
Description
Adds support for TextHeightBehavior in Text, RichText, and DefaulttextStyle.
Depends on flutter/engine#15087.
Related Issues
Adds features to resolve #47175
Tests
Golden tests added. Additional tests in engine-side PR performs unit 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].