1// Before: highlightBuilder returned a Widget.
2highlightBuilder: (context, text, style) => MyChip(text, style),
3
4// After: use InlineCodeStyle for appearance. Every field is optional; unset
5// values derive from ColorScheme and keep the default text-chip behavior:
6styleSheet: const GptMarkdownStyleSheet(
7 inlineCode: InlineCodeStyle(fontFamily: 'GeistMono'),
8),
9
10// inlineCodeBuilder receives the resolved InlineCodeStyle. Return CodeTextSpan
11// to keep the painted chip; any other TextSpan deliberately drops it:
12inlineCodeBuilder: (context, code, style, codeStyle) =>
13 CodeTextSpan(text: code, style: style, codeStyle: codeStyle),
14
15// Use baselineWidgetSpan only for a genuine inline widget. It aligns the widget
16// and handles text scaling, but WidgetSpan content cannot wrap or be selected:
17inlineCodeBuilder: (context, code, style, codeStyle) =>
18 baselineWidgetSpan(MyChip(code, style))