From 39ee0a92a8f3d74d243db206fe034330f75c0588 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Tue, 7 Mar 2023 13:11:37 +0600 Subject: [PATCH] fix(playbutton_card): title text overflow --- lib/components/shared/playbutton_card.dart | 55 +++++++++++++--------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/lib/components/shared/playbutton_card.dart b/lib/components/shared/playbutton_card.dart index 5b7c5d79a..cdf55642a 100644 --- a/lib/components/shared/playbutton_card.dart +++ b/lib/components/shared/playbutton_card.dart @@ -190,32 +190,45 @@ class PlaybuttonCard extends HookWidget { ); final list = Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ // thumbnail of the playlist - image, - const SizedBox(width: 10), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - PlatformText( - title, - style: const TextStyle(fontWeight: FontWeight.bold), - ), - const SizedBox(height: 5), - if (description != null) - PlatformText( - description!, - overflow: TextOverflow.fade, - style: PlatformTextTheme.of(context).caption, + Flexible( + child: Row( + children: [ + image, + const SizedBox(width: 10), + Flexible( + child: RichText( + overflow: TextOverflow.ellipsis, + text: TextSpan( + children: [ + TextSpan( + text: title, + style: PlatformTextTheme.of(context) + .body + ?.copyWith(fontWeight: FontWeight.bold), + ), + if (description != null) + TextSpan( + text: '\n$description', + style: PlatformTextTheme.of(context).caption, + ), + ], + ), + ), ), + ], + ), + ), + Row( + children: [ + addToQueueButton, + const SizedBox(width: 10), + playButton, + const SizedBox(width: 10), ], ), - const Spacer(), - addToQueueButton, - const SizedBox(width: 10), - playButton, - const SizedBox(width: 10), ], );