File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
flyer_chat_text_stream_message Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ dependencies:
1313 flutter :
1414 sdk : flutter
1515 flutter_chat_core : ^2.6.2
16- gpt_markdown : ^1.1.0
16+ gpt_markdown : ^1.1.1
1717 provider : ^6.1.5
1818
1919dev_dependencies :
Original file line number Diff line number Diff line change @@ -88,6 +88,9 @@ class FlyerChatTextStreamMessage extends StatefulWidget {
8888 /// The rendering mode for the text content.
8989 final TextStreamMessageMode mode;
9090
91+ /// The callback function to handle link clicks.
92+ final void Function (String url, String title)? onLinkTap;
93+
9194 /// Creates a widget to display a streaming text message.
9295 const FlyerChatTextStreamMessage ({
9396 super .key,
@@ -106,6 +109,7 @@ class FlyerChatTextStreamMessage extends StatefulWidget {
106109 this .timeAndStatusPosition = TimeAndStatusPosition .end,
107110 this .chunkAnimationDuration = const Duration (milliseconds: 350 ),
108111 this .mode = TextStreamMessageMode .animatedOpacity,
112+ this .onLinkTap,
109113 });
110114
111115 @override
@@ -339,7 +343,11 @@ class _FlyerChatTextStreamMessageState extends State<FlyerChatTextStreamMessage>
339343
340344 if (widget.streamState is StreamStateCompleted ) {
341345 final state = widget.streamState as StreamStateCompleted ;
342- return GptMarkdown (state.finalText, style: paragraphStyle);
346+ return GptMarkdown (
347+ state.finalText,
348+ style: paragraphStyle,
349+ onLinkTap: widget.onLinkTap,
350+ );
343351 }
344352
345353 // Build RichText from segments for Streaming state
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ dependencies:
1313 flutter :
1414 sdk : flutter
1515 flutter_chat_core : ^2.6.2
16- gpt_markdown : ^1.1.0
16+ gpt_markdown : ^1.1.1
1717 provider : ^6.1.5
1818
1919dev_dependencies :
You can’t perform that action at this time.
0 commit comments