From cd476f39c0c244c3ed77b31ee550a8c14eca16a3 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 9 Feb 2024 09:56:03 -0800 Subject: [PATCH] Make Contact Row Layout More Consistent --- lib/widgets/contactrow.dart | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/widgets/contactrow.dart b/lib/widgets/contactrow.dart index c78e090a..dbeb0ee7 100644 --- a/lib/widgets/contactrow.dart +++ b/lib/widgets/contactrow.dart @@ -82,14 +82,15 @@ class _ContactRowState extends State { padding: EdgeInsets.all(10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.min, children: [ Container( - height: 24, clipBehavior: Clip.hardEdge, + height: Provider.of(context).fontScaling * 14.0 + 10.0, decoration: BoxDecoration(), child: Text( - contact.augmentedNickname(context) + (contact.messageDraft.isEmpty() ? "" : "*"), - + contact.augmentedNickname(context).trim() + (contact.messageDraft.isEmpty() ? "" : "*"), style: TextStyle( fontSize: Provider.of(context).fontScaling * 14.0, fontFamily: "Inter", @@ -101,13 +102,11 @@ class _ContactRowState extends State { overflow: TextOverflow.clip, maxLines: 1, )), - syncStatus ?? Container(), - Visibility( - visible: !Provider.of(context).streamerMode, - child: Text(contact.onion, - overflow: TextOverflow.ellipsis, - style: TextStyle(color: contact.isBlocked ? Provider.of(context).theme.portraitBlockedTextColor : Provider.of(context).theme.mainTextColor)), - ), + syncStatus ?? + SizedBox( + width: 0, + height: 0, + ), // we need to ignore the child widget in this context, otherwise gesture events will flow down... IgnorePointer( ignoring: true, @@ -121,6 +120,7 @@ class _ContactRowState extends State { )), Container( padding: EdgeInsets.all(0), + height: Provider.of(context).fontScaling * 14.0 + 10.0, child: contact.isInvitation == true ? Wrap(alignment: WrapAlignment.start, direction: Axis.vertical, children: [ Padding( @@ -161,6 +161,15 @@ class _ContactRowState extends State { ) : Text(prettyDateString(context, widget.messageIndex == null ? contact.lastMessageSentTime : (this.cachedMessage?.getMetadata().timestamp ?? DateTime.now())))), ), + Visibility( + visible: !Provider.of(context).streamerMode, + child: Text( + contact.onion, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: ((contact.isBlocked ? Provider.of(context).theme.portraitBlockedTextColor : Provider.of(context).theme.mainTextColor) as Color) + .withOpacity(0.8)), + )), ], ))), Visibility(