|
|
|
|
@ -107,9 +107,9 @@ class CopilotMessageBubble extends StatelessWidget {
|
|
|
|
|
width: 36,
|
|
|
|
|
padding: const EdgeInsets.all(8),
|
|
|
|
|
decoration: BoxDecoration(color: AppColor.background(context), shape: BoxShape.circle, border: Border.all(color: Colors.transparent)),
|
|
|
|
|
child: "copilot_logo".toSvgAsset(width: 14, height: 14)),
|
|
|
|
|
child: "atoms_logo".toSvgAsset(width: 14, height: 14)),
|
|
|
|
|
8.width,
|
|
|
|
|
const InfoTextLabelWidget(label: "Assistant"),
|
|
|
|
|
const InfoTextLabelWidget(label: "Atoms"),
|
|
|
|
|
// Text(
|
|
|
|
|
// "Copilot",
|
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
|
@ -205,35 +205,38 @@ class CopilotMessageBubble extends StatelessWidget {
|
|
|
|
|
(match) => '${match.group(1)} \n',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return MarkdownBody(
|
|
|
|
|
data: content,
|
|
|
|
|
selectable: true,
|
|
|
|
|
onTapLink: (text, href, title) async {
|
|
|
|
|
if (href == null || href.isEmpty) return;
|
|
|
|
|
return Directionality(
|
|
|
|
|
textDirection: context.settingProvider.isArabic ? TextDirection.rtl : TextDirection.ltr,
|
|
|
|
|
child: MarkdownBody(
|
|
|
|
|
data: content,
|
|
|
|
|
selectable: true,
|
|
|
|
|
onTapLink: (text, href, title) async {
|
|
|
|
|
if (href == null || href.isEmpty) return;
|
|
|
|
|
|
|
|
|
|
final uri = Uri.tryParse(href);
|
|
|
|
|
final uri = Uri.tryParse(href);
|
|
|
|
|
|
|
|
|
|
if (uri == null) return;
|
|
|
|
|
if (uri == null) return;
|
|
|
|
|
|
|
|
|
|
await launchUrl(
|
|
|
|
|
uri,
|
|
|
|
|
mode: LaunchMode.externalApplication,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
styleSheet: MarkdownStyleSheet(
|
|
|
|
|
p: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
color: message.isError ? Colors.red : AppColor.textStyleColor(context),
|
|
|
|
|
),
|
|
|
|
|
strong: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
color: message.isError ? Colors.red : AppColor.textStyleColor(context),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
listBullet: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
color: message.isError ? Colors.red : AppColor.textStyleColor(context),
|
|
|
|
|
),
|
|
|
|
|
a: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
color: AppColor.primary10,
|
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
|
await launchUrl(
|
|
|
|
|
uri,
|
|
|
|
|
mode: LaunchMode.externalApplication,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
styleSheet: MarkdownStyleSheet(
|
|
|
|
|
p: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
color: message.isError ? Colors.red : AppColor.textStyleColor(context),
|
|
|
|
|
),
|
|
|
|
|
strong: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
color: message.isError ? Colors.red : AppColor.textStyleColor(context),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
listBullet: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
color: message.isError ? Colors.red : AppColor.textStyleColor(context),
|
|
|
|
|
),
|
|
|
|
|
a: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
color: AppColor.primary10,
|
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|