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

Add missing properties to TextStyle.apply #54305

Merged
merged 2 commits into from Apr 8, 2020

Conversation

GaryQian
Copy link
Contributor

@GaryQian GaryQian commented Apr 8, 2020

Description

TextStyle.apply was missing some of the more modern features added to TextStyle. This adds the missing properties such as shadow and fontFeatures.

Related Issues

Fixes #24623

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.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read [Handling breaking changes].

  • No, no existing tests failed, so this is not a breaking change.

@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Apr 8, 2020
@GaryQian GaryQian added a: typography Text rendering, possibly libtxt waiting for tree to go green labels Apr 8, 2020
@fluttergithubbot fluttergithubbot merged commit 19ff596 into flutter:master Apr 8, 2020
@lapbay
Copy link

lapbay commented Apr 10, 2020

This fix will cause a text style lost its textBaseline property after the TextTheme.apply method being called, which will make all the TextField instances crash. In the apply method of TextTheme we can't provide a value for textBaseline, but it seems you have decided to make textBaseline required in textStyle's apply method.
var textTheme = Theme.of(context).textTheme;
print(textTheme.subtitle1);
textTheme = textTheme.apply(
bodyColor: Colors.black,
);
print(textTheme.subtitle1);

print result:
flutter: TextStyle(debugLabel: (englishLike subhead 2014).merge(blackCupertino subtitle1), inherit: false, color: Color(0xdd000000), family: .SF UI Text, size: 16.0, weight: 400, baseline: alphabetic, decoration: TextDecoration.none)
flutter: TextStyle(debugLabel: ((englishLike subhead 2014).merge(blackCupertino subtitle1)).apply, inherit: false, color: Color(0xff000000), family: .SF UI Text, size: 16.0, weight: 400, decoration: Color(0xff000000) TextDecoration.none)

@GaryQian
Copy link
Contributor Author

Ahh I will fix that, thanks for reporting!

@GaryQian
Copy link
Contributor Author

#54442 Fixes it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: typography Text rendering, possibly libtxt framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextStyle.apply is missing shadows argument
5 participants