Skip to content

Commit 33e17a4

Browse files
chrisbobbegnprice
authored andcommitted
content: Use weightVariableTextStyle in ContentTheme.textStyleError
This converts the last remaining place where we were using TextStyle.fontWeight directly, when we should have been using weightVariableTextStyle. (In a future with flutter/flutter#148026 , though, we'll want to change all uses of weightVariableTextStyle back to plain TextStyle.fontWeight.) Now, this text is styled with a `wght` value of 700, instead of 400 from the ambient style. The FontWeight.bold seems to have already been causing the spans to render more boldly than surrounding text, but in a way that doesn't match what we get for Source Code Pro with `wght` 700. I think this is because of flutter/flutter#136779 .
1 parent d98a9e3 commit 33e17a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/widgets/content.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
4747
)
4848
.merge(weightVariableTextStyle(context))
4949
.copyWith(debugLabel: 'ContentTheme.textStylePlainParagraph'),
50-
textStyleError = const TextStyle(
51-
fontSize: kBaseFontSize, fontWeight: FontWeight.bold, color: Colors.red),
50+
textStyleError = const TextStyle(fontSize: kBaseFontSize, color: Colors.red)
51+
.merge(weightVariableTextStyle(context, wght: 700)),
5252
textStyleErrorCode = kMonospaceTextStyle
5353
.merge(const TextStyle(fontSize: kBaseFontSize, color: Colors.red));
5454

0 commit comments

Comments
 (0)