25 lines
586 B
Dart
25 lines
586 B
Dart
import "package:gpt_markdown/gpt_markdown.dart";
|
|
import "package:shadcn_flutter/shadcn_flutter.dart";
|
|
|
|
class AssistantBubble extends StatelessWidget {
|
|
const AssistantBubble({super.key, required this.content, this.isStreaming = false});
|
|
|
|
final String content;
|
|
final bool isStreaming;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
|
|
if (isStreaming) {
|
|
return SelectableText(
|
|
content,
|
|
style: TextStyle(
|
|
color: Theme.of(context).colorScheme.foreground,
|
|
fontSize: 14,
|
|
),
|
|
);
|
|
}
|
|
|
|
return GptMarkdown(content);
|
|
}
|
|
}
|