@@ -54,6 +54,8 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
5454 textStylePlainParagraph: _plainParagraphCommon (context).copyWith (
5555 color: const HSLColor .fromAHSL (1 , 0 , 0 , 0.15 ).toColor (),
5656 debugLabel: 'ContentTheme.textStylePlainParagraph' ),
57+ textStyleEmoji: TextStyle (
58+ fontFamily: emojiFontFamily, fontFamilyFallback: const []),
5759 codeBlockTextStyles: CodeBlockTextStyles .light (context),
5860 textStyleError: const TextStyle (fontSize: kBaseFontSize, color: Colors .red)
5961 .merge (weightVariableTextStyle (context, wght: 700 )),
@@ -85,6 +87,8 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
8587 textStylePlainParagraph: _plainParagraphCommon (context).copyWith (
8688 color: const HSLColor .fromAHSL (1 , 0 , 0 , 0.85 ).toColor (),
8789 debugLabel: 'ContentTheme.textStylePlainParagraph' ),
90+ textStyleEmoji: TextStyle (
91+ fontFamily: emojiFontFamily, fontFamilyFallback: const []),
8892 codeBlockTextStyles: CodeBlockTextStyles .dark (context),
8993 textStyleError: const TextStyle (fontSize: kBaseFontSize, color: Colors .red)
9094 .merge (weightVariableTextStyle (context, wght: 700 )),
@@ -113,6 +117,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
113117 required this .colorTableHeaderBackground,
114118 required this .colorThematicBreak,
115119 required this .textStylePlainParagraph,
120+ required this .textStyleEmoji,
116121 required this .codeBlockTextStyles,
117122 required this .textStyleError,
118123 required this .textStyleErrorCode,
@@ -152,6 +157,9 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
152157 /// should not need styles from other sources, such as Material defaults.
153158 final TextStyle textStylePlainParagraph;
154159
160+ /// The [TextStyle] to use for Unicode emoji.
161+ final TextStyle textStyleEmoji;
162+
155163 final CodeBlockTextStyles codeBlockTextStyles;
156164 final TextStyle textStyleError;
157165 final TextStyle textStyleErrorCode;
@@ -201,6 +209,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
201209 Color ? colorTableHeaderBackground,
202210 Color ? colorThematicBreak,
203211 TextStyle ? textStylePlainParagraph,
212+ TextStyle ? textStyleEmoji,
204213 CodeBlockTextStyles ? codeBlockTextStyles,
205214 TextStyle ? textStyleError,
206215 TextStyle ? textStyleErrorCode,
@@ -222,6 +231,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
222231 colorTableHeaderBackground: colorTableHeaderBackground ?? this .colorTableHeaderBackground,
223232 colorThematicBreak: colorThematicBreak ?? this .colorThematicBreak,
224233 textStylePlainParagraph: textStylePlainParagraph ?? this .textStylePlainParagraph,
234+ textStyleEmoji: textStyleEmoji ?? this .textStyleEmoji,
225235 codeBlockTextStyles: codeBlockTextStyles ?? this .codeBlockTextStyles,
226236 textStyleError: textStyleError ?? this .textStyleError,
227237 textStyleErrorCode: textStyleErrorCode ?? this .textStyleErrorCode,
@@ -250,6 +260,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
250260 colorTableHeaderBackground: Color .lerp (colorTableHeaderBackground, other.colorTableHeaderBackground, t)! ,
251261 colorThematicBreak: Color .lerp (colorThematicBreak, other.colorThematicBreak, t)! ,
252262 textStylePlainParagraph: TextStyle .lerp (textStylePlainParagraph, other.textStylePlainParagraph, t)! ,
263+ textStyleEmoji: TextStyle .lerp (textStyleEmoji, other.textStyleEmoji, t)! ,
253264 codeBlockTextStyles: CodeBlockTextStyles .lerp (codeBlockTextStyles, other.codeBlockTextStyles, t),
254265 textStyleError: TextStyle .lerp (textStyleError, other.textStyleError, t)! ,
255266 textStyleErrorCode: TextStyle .lerp (textStyleErrorCode, other.textStyleErrorCode, t)! ,
@@ -1031,7 +1042,9 @@ class _InlineContentBuilder {
10311042 child: UserMention (ambientTextStyle: widget.style, node: node));
10321043
10331044 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));
10351048
10361049 case ImageEmojiNode ():
10371050 return WidgetSpan (alignment: PlaceholderAlignment .middle,
0 commit comments