Skip to content

Commit fcc83da

Browse files
chrisbobbegnprice
authored andcommitted
home: Use weightVariableTextStyle instead of 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 . We could probably have left out the `const TextStyle().merge()`; I think the only difference it causes is in the resulting style's debugLabel. But I figured we might as well be consistent in how we use weightVariableTextStyle, and in any case it should disappear with flutter/flutter#148026 .
1 parent c4c1eeb commit fcc83da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/widgets/app.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import 'page.dart';
1515
import 'recent_dm_conversations.dart';
1616
import 'store.dart';
1717
import 'subscription_list.dart';
18+
import 'text.dart';
1819
import 'theme.dart';
1920

2021
class ZulipApp extends StatefulWidget {
@@ -242,7 +243,8 @@ class HomePage extends StatelessWidget {
242243
final zulipLocalizations = ZulipLocalizations.of(context);
243244

244245
InlineSpan bold(String text) => TextSpan(
245-
text: text, style: const TextStyle(fontWeight: FontWeight.bold));
246+
style: const TextStyle().merge(weightVariableTextStyle(context, wght: 700)),
247+
text: text);
246248

247249
int? testStreamId;
248250
if (store.connection.realmUrl.origin == 'https://chat.zulip.org') {

0 commit comments

Comments
 (0)