highlight mentions

This commit is contained in:
Salvatore Giordano
2020-03-04 15:41:52 +01:00
parent c37ed34802
commit a563e8f19a
3 changed files with 146 additions and 12 deletions
+6 -1
View File
@@ -361,6 +361,11 @@ class _MessageWidgetState extends State<MessageWidget>
);
if (widget.message.text.trim().isNotEmpty) {
String text = widget.message.text;
widget.message.mentionedUsers?.forEach((u) {
text = text.replaceAll(u.name, '**${u.name}**');
});
column.children.addAll(
<Widget>[
Column(
@@ -393,7 +398,7 @@ class _MessageWidgetState extends State<MessageWidget>
padding: EdgeInsets.all(10),
constraints: BoxConstraints.loose(Size.fromWidth(300)),
child: MarkdownBody(
data: '${widget.message.text}',
data: '${text}',
onTapLink: (link) {
_launchURL(link);
},