-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Adds support for applying delta/factor transformations for TextTheme height, letter and word spacing #158103
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
Conversation
|
Thanks for the PR! Can you undo the formatting changes here to make it easier to review? |
|
Will do as soon as I get a chance.
In the future, what can we contributors do to ensure that formatting is
applied the same way the flutter repo expects it to.
…On Thu, Nov 7, 2024 at 6:11 PM Justin McCandless ***@***.***> wrote:
Thanks for the PR! Can you undo the formatting changes here to make it
easier to review?
—
Reply to this email directly, view it on GitHub
<#158103 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASDJ62ZDKT7GJZENIPDVSKDZ7PXQ5AVCNFSM6AAAAABRENE6OGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRTGQYDINRTGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Done |
nate-thegrate
left a comment
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.
Including all the TextStyle.apply() parameters in TextTheme.apply() sounds to me like a no-brainer 👍
LGTM, thanks for the contribution!
This comment was marked as resolved.
This comment was marked as resolved.
In the future, we'll likely be adopting the new autoformatter! But until then, it'd probably be good to turn the formatter off in your IDE while editing files in this repository. |
ProblemSeems there are some inconsistencies how Applying it to a I wish this wasn't the case. Semi-SolutionTo avoid this I've done the following:
All tests pass now. Best SolutionIMHO, we should remove this inconstancy by either removing the assert from letterSpacing and wordSpacing (no breaking changes) or add an assert for height too (breaking change) |
This comment was marked as resolved.
This comment was marked as resolved.
|
@Renzo-Olivares any idea what's going on with Google testing? |
Renzo-Olivares
left a comment
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, thanks for the contribution!
|
@nate-thegrate This one is looking like a breaking change for all users that override |
|
Hmmm, any update on this? |
|
Hi @dickermoshe, sorry for the delay. I’ll be taking a look this week. |
Renzo-Olivares
left a comment
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.
@dickermoshe Thank you for your patience on this PR. Could you rebase the PR to the latest? There has been lots of changes (monorepo/autoformatter) since I last visited this PR. I have also gone through the google testing and fixed the issue, once the rebase is done we can move forward with merging this.
|
I've updated the PR with rebasing. |
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.
Looks like Linux Analyze failed since this file doesn't match the auto-formatter.
|
Hey @dickermoshe would you like to return to this change? The analyzer check is failing due to formatting. |
|
FYI running |
|
It's a lot of files, stand by... |
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)
…xtTheme height, letter and word spacing (flutter/flutter#158103)

Closes #158102
The text theme has the
applymethod which does bulk operations on multiple text styles. It supports delta/factor ajustements for font size. This is very helpful for changing all the font sizes at once using a ratio or a simple delta.This PR add support for height, letter spacing and and word spacing too.
Why is this so useful?
Adjusting these in bulk is really helpful for using custom fonts. The Material font comes which its own default text styes and they're usually great. But many times they need to be nudged tighter.
Doc Comment
applyhas no doc comments forfontSizeFactor/fontSizeDeltaso i did not add any for the newletterSpacingFactor,letterSpacingDelta... either. If we want to add it, I'll do it.Tests
Done!
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.