⬆️ Support some new server stuff

This commit is contained in:
2024-05-10 23:17:01 +08:00
parent c1d3bac0c8
commit 40aa16e971
41 changed files with 105 additions and 69 deletions

View File

@@ -10,19 +10,23 @@ class ChatMessageContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Markdown(
data: item.content,
shrinkWrap: true,
selectable: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(0),
onTapLink: (text, href, title) async {
if (href == null) return;
await launchUrlString(
href,
mode: LaunchMode.externalApplication,
);
},
);
if (item.type == 'm.text') {
return Markdown(
data: item.decodedContent['value'],
shrinkWrap: true,
selectable: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(0),
onTapLink: (text, href, title) async {
if (href == null) return;
await launchUrlString(
href,
mode: LaunchMode.externalApplication,
);
},
);
}
return Container();
}
}