Skip to content

Commit d62554f

Browse files
committed
feat( add textContent to FlyerChatTextMessage
1 parent f671892 commit d62554f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/flyer_chat_text_message/lib/src/flyer_chat_text_message.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ class FlyerChatTextMessage extends StatelessWidget {
123123
/// The widget to display on top of the message.
124124
final Widget? topWidget;
125125

126+
/// Widget to display as text, overriding message text.
127+
final Widget? textContent;
128+
126129
/// Creates a widget to display a text message.
127130
const FlyerChatTextMessage({
128131
super.key,
@@ -149,6 +152,7 @@ class FlyerChatTextMessage extends StatelessWidget {
149152
this.onLinkTap,
150153
this.linkPreviewPosition = LinkPreviewPosition.bottom,
151154
this.topWidget,
155+
this.textContent,
152156
});
153157

154158
bool get _isOnlyEmoji => message.metadata?['isOnlyEmoji'] == true;
@@ -188,7 +192,7 @@ class FlyerChatTextMessage extends StatelessWidget {
188192
)
189193
: null;
190194

191-
final textContent = GptMarkdownTheme(
195+
final textContent = textContent ?? GptMarkdownTheme(
192196
gptThemeData: GptMarkdownTheme.of(context),
193197
child: GptMarkdown(
194198
message.text,

0 commit comments

Comments
 (0)