From 6f26ea6df2e2a3454660cbc784f5daaf86f23904 Mon Sep 17 00:00:00 2001 From: mikecoomber <58986130+mikecoomber@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:57:34 +0000 Subject: [PATCH] fix: Attachment names on comments now elipsize correctly (#44) --- lib/src/components/molecules/comment.dart | 30 ++++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/src/components/molecules/comment.dart b/lib/src/components/molecules/comment.dart index c4c62d7..ed604d7 100644 --- a/lib/src/components/molecules/comment.dart +++ b/lib/src/components/molecules/comment.dart @@ -246,20 +246,26 @@ class _AttachmentRow extends StatelessWidget { size: 40, ), SizedBox(width: spacing.small), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - attachment.name, - style: ZetaTextStyles.bodySmall, - ), - if (attachment.size != null) + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ Text( - attachment.size!, - style: ZetaTextStyles.bodySmall.copyWith(color: colors.textSubtle), + attachment.name, + style: ZetaTextStyles.bodySmall, + maxLines: 1, + overflow: TextOverflow.ellipsis, ), - ], + if (attachment.size != null) + Text( + attachment.size!, + style: ZetaTextStyles.bodySmall.copyWith(color: colors.textSubtle), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ], + ), ), ], ),