From fc29b10f12844dec2a7100cd16c055ca76ca5295 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 27 Jul 2022 10:35:54 -0700 Subject: [PATCH] Fix Quoting of Large Messages --- lib/views/messageview.dart | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/lib/views/messageview.dart b/lib/views/messageview.dart index a17fea69..27bbe662 100644 --- a/lib/views/messageview.dart +++ b/lib/views/messageview.dart @@ -580,6 +580,9 @@ class _MessageViewState extends State { builder: (context, snapshot) { if (snapshot.hasData) { var message = snapshot.data! as Message; + var qTextColor = message.getMetadata().senderHandle != Provider.of(context).selectedProfile + ? Provider.of(context).theme.messageFromOtherTextColor + : Provider.of(context).theme.messageFromMeTextColor; return Container( margin: EdgeInsets.all(5), padding: EdgeInsets.all(5), @@ -588,6 +591,26 @@ class _MessageViewState extends State { : Provider.of(context).theme.messageFromMeBackgroundColor, child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Stack(children: [ + Container( + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(5), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: message.getMetadata().senderHandle != Provider.of(context).selectedProfile + ? Provider.of(context).theme.messageFromOtherBackgroundColor + : Provider.of(context).theme.messageFromMeBackgroundColor, + ), + height: 75, + child: Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ + Padding(padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0), child: Icon(Icons.reply, size: 32, color: qTextColor)), + Flexible( + child: DefaultTextStyle( + textWidthBasis: TextWidthBasis.parent, + child: message.getPreviewWidget(context), + style: TextStyle(color: qTextColor), + overflow: TextOverflow.fade, + )) + ])), Align( alignment: Alignment.topRight, child: IconButton( @@ -598,16 +621,7 @@ class _MessageViewState extends State { Provider.of(context, listen: false).selectedIndex = null; }, )), - Align( - alignment: Alignment.topLeft, - child: Padding(padding: EdgeInsets.all(2.0), child: Icon(Icons.reply)), - ) ]), - Wrap( - runAlignment: WrapAlignment.spaceEvenly, - alignment: WrapAlignment.center, - runSpacing: 1.0, - children: [Center(widthFactor: 1.0, child: Padding(padding: EdgeInsets.all(10.0), child: message.getPreviewWidget(context)))]), ])); } else { return MessageLoadingBubble();