From d40b87750432502421633f5c775f0aa58f190842 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Sat, 21 Dec 2019 22:01:08 +0800 Subject: [PATCH] fix: text overflow --- lib/widgets/repository_item.dart | 43 +++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/lib/widgets/repository_item.dart b/lib/widgets/repository_item.dart index ae6a83b..29d3a9e 100644 --- a/lib/widgets/repository_item.dart +++ b/lib/widgets/repository_item.dart @@ -157,22 +157,30 @@ class RepositoryItem extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - owner + ' / ', - style: TextStyle( - fontSize: 17, - color: theme.palette.primary, + Expanded( + child: Row( + children: [ + Text( + owner + ' / ', + style: TextStyle( + fontSize: 17, + color: theme.palette.primary, + ), + ), + Expanded( + child: Text( + name, + style: TextStyle( + fontSize: 17, + color: theme.palette.primary, + fontWeight: FontWeight.w600, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ], ), ), - Text( - name, - style: TextStyle( - fontSize: 17, - color: theme.palette.primary, - fontWeight: FontWeight.w600, - ), - ), - Expanded(child: Container()), Icon(iconData, size: 17, color: theme.palette.tertiaryText), ], ), @@ -224,7 +232,12 @@ class RepositoryItem extends StatelessWidget { ), ), SizedBox(width: 4), - Text(primaryLanguageName ?? 'Unknown'), + Expanded( + child: Text( + primaryLanguageName ?? 'Unknown', + overflow: TextOverflow.ellipsis, + ), + ), ]), ), Expanded(