From d339fc5f7a3e4e00ae336b843d32c581dc9fa300 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Mon, 31 Jul 2023 10:13:38 +0800 Subject: [PATCH] fix: reaction not show because the width too big --- lib/pages/chat/events/message_reactions.dart | 35 +++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lib/pages/chat/events/message_reactions.dart b/lib/pages/chat/events/message_reactions.dart index 77f87f4b57..b642e7afa8 100644 --- a/lib/pages/chat/events/message_reactions.dart +++ b/lib/pages/chat/events/message_reactions.dart @@ -118,23 +118,26 @@ class _Reaction extends StatelessWidget { final fontSize = DefaultTextStyle.of(context).style.fontSize; Widget content; if (reactionKey!.startsWith('mxc://')) { - content = Row( - mainAxisSize: MainAxisSize.min, - children: [ - MxcImage( - uri: Uri.parse(reactionKey!), - width: 9999, - height: fontSize, - ), - const SizedBox(width: 4), - Text( - count.toString(), - style: TextStyle( - color: textColor, - fontSize: DefaultTextStyle.of(context).style.fontSize, + content = SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + MxcImage( + uri: Uri.parse(reactionKey!), + width: fontSize == null ? 99.0 : fontSize * 2, + height: fontSize, ), - ), - ], + const SizedBox(width: 4), + Text( + count.toString(), + style: TextStyle( + color: textColor, + fontSize: DefaultTextStyle.of(context).style.fontSize, + ), + ), + ], + ), ); } else { var renderKey = Characters(reactionKey!);