@@ -54,6 +54,8 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
54
54
textStylePlainParagraph: _plainParagraphCommon (context).copyWith (
55
55
color: const HSLColor .fromAHSL (1 , 0 , 0 , 0.15 ).toColor (),
56
56
debugLabel: 'ContentTheme.textStylePlainParagraph' ),
57
+ textStyleEmoji: TextStyle (
58
+ fontFamily: emojiFontFamily, fontFamilyFallback: const []),
57
59
codeBlockTextStyles: CodeBlockTextStyles .light (context),
58
60
textStyleError: const TextStyle (fontSize: kBaseFontSize, color: Colors .red)
59
61
.merge (weightVariableTextStyle (context, wght: 700 )),
@@ -85,6 +87,8 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
85
87
textStylePlainParagraph: _plainParagraphCommon (context).copyWith (
86
88
color: const HSLColor .fromAHSL (1 , 0 , 0 , 0.85 ).toColor (),
87
89
debugLabel: 'ContentTheme.textStylePlainParagraph' ),
90
+ textStyleEmoji: TextStyle (
91
+ fontFamily: emojiFontFamily, fontFamilyFallback: const []),
88
92
codeBlockTextStyles: CodeBlockTextStyles .dark (context),
89
93
textStyleError: const TextStyle (fontSize: kBaseFontSize, color: Colors .red)
90
94
.merge (weightVariableTextStyle (context, wght: 700 )),
@@ -113,6 +117,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
113
117
required this .colorTableHeaderBackground,
114
118
required this .colorThematicBreak,
115
119
required this .textStylePlainParagraph,
120
+ required this .textStyleEmoji,
116
121
required this .codeBlockTextStyles,
117
122
required this .textStyleError,
118
123
required this .textStyleErrorCode,
@@ -152,6 +157,9 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
152
157
/// should not need styles from other sources, such as Material defaults.
153
158
final TextStyle textStylePlainParagraph;
154
159
160
+ /// The [TextStyle] to use for Unicode emoji.
161
+ final TextStyle textStyleEmoji;
162
+
155
163
final CodeBlockTextStyles codeBlockTextStyles;
156
164
final TextStyle textStyleError;
157
165
final TextStyle textStyleErrorCode;
@@ -201,6 +209,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
201
209
Color ? colorTableHeaderBackground,
202
210
Color ? colorThematicBreak,
203
211
TextStyle ? textStylePlainParagraph,
212
+ TextStyle ? textStyleEmoji,
204
213
CodeBlockTextStyles ? codeBlockTextStyles,
205
214
TextStyle ? textStyleError,
206
215
TextStyle ? textStyleErrorCode,
@@ -222,6 +231,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
222
231
colorTableHeaderBackground: colorTableHeaderBackground ?? this .colorTableHeaderBackground,
223
232
colorThematicBreak: colorThematicBreak ?? this .colorThematicBreak,
224
233
textStylePlainParagraph: textStylePlainParagraph ?? this .textStylePlainParagraph,
234
+ textStyleEmoji: textStyleEmoji ?? this .textStyleEmoji,
225
235
codeBlockTextStyles: codeBlockTextStyles ?? this .codeBlockTextStyles,
226
236
textStyleError: textStyleError ?? this .textStyleError,
227
237
textStyleErrorCode: textStyleErrorCode ?? this .textStyleErrorCode,
@@ -250,6 +260,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
250
260
colorTableHeaderBackground: Color .lerp (colorTableHeaderBackground, other.colorTableHeaderBackground, t)! ,
251
261
colorThematicBreak: Color .lerp (colorThematicBreak, other.colorThematicBreak, t)! ,
252
262
textStylePlainParagraph: TextStyle .lerp (textStylePlainParagraph, other.textStylePlainParagraph, t)! ,
263
+ textStyleEmoji: TextStyle .lerp (textStyleEmoji, other.textStyleEmoji, t)! ,
253
264
codeBlockTextStyles: CodeBlockTextStyles .lerp (codeBlockTextStyles, other.codeBlockTextStyles, t),
254
265
textStyleError: TextStyle .lerp (textStyleError, other.textStyleError, t)! ,
255
266
textStyleErrorCode: TextStyle .lerp (textStyleErrorCode, other.textStyleErrorCode, t)! ,
@@ -1031,7 +1042,9 @@ class _InlineContentBuilder {
1031
1042
child: UserMention (ambientTextStyle: widget.style, node: node));
1032
1043
1033
1044
case UnicodeEmojiNode ():
1034
- return TextSpan (text: node.emojiUnicode, recognizer: _recognizer);
1045
+ return TextSpan (text: node.emojiUnicode, recognizer: _recognizer,
1046
+ style: widget.style
1047
+ .merge (ContentTheme .of (_context! ).textStyleEmoji));
1035
1048
1036
1049
case ImageEmojiNode ():
1037
1050
return WidgetSpan (alignment: PlaceholderAlignment .middle,
0 commit comments