Skip to content

Commit 910fe5c

Browse files
chrisbobbegnprice
authored andcommitted
text [nfc]: Pull out a helper (convertGeometry in zulipTypography)
We'll add another across-the-board geometry conversion soon.
1 parent 45e4434 commit 910fe5c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/widgets/text.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ import 'package:flutter/material.dart';
3434
Typography zulipTypography(BuildContext context) {
3535
final typography = Theme.of(context).typography;
3636

37+
convertGeometry(TextTheme inputTextTheme) {
38+
TextTheme result = _weightVariableTextTheme(context, inputTextTheme);
39+
return result;
40+
}
41+
3742
Typography result = typography.copyWith(
3843
black: typography.black.apply(
3944
fontFamily: kDefaultFontFamily,
@@ -42,9 +47,9 @@ Typography zulipTypography(BuildContext context) {
4247
fontFamily: kDefaultFontFamily,
4348
fontFamilyFallback: defaultFontFamilyFallback),
4449

45-
dense: _weightVariableTextTheme(context, typography.dense),
46-
englishLike: _weightVariableTextTheme(context, typography.englishLike),
47-
tall: _weightVariableTextTheme(context, typography.tall),
50+
dense: convertGeometry(typography.dense),
51+
englishLike: convertGeometry(typography.englishLike),
52+
tall: convertGeometry(typography.tall),
4853
);
4954

5055
assert(() {

0 commit comments

Comments
 (0)