From ca16b45c1819817c387b067e081936106a97f262 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 12 Jun 2025 09:56:14 -0400 Subject: [PATCH] chore: convert matrix mention widget into richtext --- lib/pages/chat/events/html_message.dart | 70 +++++++++++++++++-------- 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/lib/pages/chat/events/html_message.dart b/lib/pages/chat/events/html_message.dart index ede3ddb6b..ff6f92aae 100644 --- a/lib/pages/chat/events/html_message.dart +++ b/lib/pages/chat/events/html_message.dart @@ -893,30 +893,56 @@ class MatrixPill extends StatelessWidget { return InkWell( splashColor: Colors.transparent, onTap: UrlLauncher(outerContext, uri).launchUrl, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Avatar( - mxContent: avatar, - name: name, - size: 16, - // #Pangea - userId: userId, - // Pangea# - ), - const SizedBox(width: 6), - Text( - name, - style: TextStyle( - color: color, - decorationColor: color, - decoration: TextDecoration.underline, - fontSize: fontSize, - height: 1.25, + // #Pangea + child: RichText( + textScaler: TextScaler.noScaling, + text: TextSpan( + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: Avatar( + mxContent: avatar, + name: name, + size: 16, + userId: userId, + ), ), - ), - ], + const WidgetSpan(child: SizedBox(width: 6)), + TextSpan( + text: name, + style: TextStyle( + color: color, + decorationColor: color, + decoration: TextDecoration.underline, + fontSize: fontSize, + height: 1.25, + ), + ), + ], + ), ), + // child: Row( + // mainAxisSize: MainAxisSize.min, + // children: [ + // Avatar( + // mxContent: avatar, + // name: name, + // size: 16, + // ), + // const SizedBox(width: 6), + // Text( + // name, + // style: TextStyle( + // color: color, + // decorationColor: color, + // decoration: TextDecoration.underline, + // fontSize: fontSize, + // height: 1.25, + // ), + // ), + // ], + // ), + // Pangea# ); } }