diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 386c79f..a39ed32 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -23,7 +23,7 @@ class StorageKeys { } class CommonStyle { - static const padding = EdgeInsets.all(12); + static const padding = EdgeInsets.symmetric(horizontal: 16, vertical: 12); static final border = BorderView(); static const verticalGap = SizedBox(height: 18); static final monospace = Platform.isIOS ? 'Menlo' : 'monospace'; // FIXME: diff --git a/lib/widgets/avatar.dart b/lib/widgets/avatar.dart index 44ccd1a..9cf2f4b 100644 --- a/lib/widgets/avatar.dart +++ b/lib/widgets/avatar.dart @@ -26,7 +26,7 @@ class Avatar extends StatelessWidget { Widget build(BuildContext context) { return GestureDetector( child: ClipRRect( - borderRadius: borderRadius ?? BorderRadius.circular(4), + borderRadius: borderRadius ?? BorderRadius.circular(size / 2), child: FadeInImage.assetNetwork( placeholder: 'images/avatar.png', image: url ?? 'images/avatar.png', diff --git a/lib/widgets/repository_item.dart b/lib/widgets/repository_item.dart index f42cbc0..b1132f6 100644 --- a/lib/widgets/repository_item.dart +++ b/lib/widgets/repository_item.dart @@ -39,22 +39,26 @@ class RepositoryItem extends StatelessWidget { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Avatar(url: avatarUrl, size: AvatarSize.small, linkUrl: '/$owner'), - SizedBox(width: 8), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: join(SizedBox(height: 8), [ + children: [ Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Avatar( + url: avatarUrl, + size: AvatarSize.small, + linkUrl: '/$owner', + ), + SizedBox(width: 8), Expanded( child: Row( children: [ Text( owner + ' / ', style: TextStyle( - fontSize: 17, + fontSize: 18, color: theme.palette.primary, ), ), @@ -62,7 +66,7 @@ class RepositoryItem extends StatelessWidget { child: Text( name, style: TextStyle( - fontSize: 17, + fontSize: 18, color: theme.palette.primary, fontWeight: FontWeight.w600, ), @@ -72,66 +76,58 @@ class RepositoryItem extends StatelessWidget { ], ), ), - Icon(iconData, - size: 17, color: theme.palette.tertiaryText), + // Icon(iconData, + // size: 17, color: theme.palette.tertiaryText), ], ), - if (description != null && description.isNotEmpty) + SizedBox(height: 6), + if (description != null && description.isNotEmpty) ...[ Text( description, - overflow: TextOverflow.ellipsis, style: TextStyle( color: theme.palette.secondaryText, - fontSize: 15, + fontSize: 16, ), ), + SizedBox(height: 10), + ], DefaultTextStyle( - style: TextStyle(color: theme.palette.text, fontSize: 13), + style: TextStyle(color: theme.palette.text, fontSize: 14), child: Row( children: [ - Expanded( - child: Row(children: [ - Container( - width: 10, - height: 10, - decoration: BoxDecoration( - color: convertColor(primaryLanguageColor), - shape: BoxShape.circle, - ), + if (primaryLanguageName != null) ...[ + Container( + width: 12, + height: 12, + decoration: BoxDecoration( + color: convertColor(primaryLanguageColor), + shape: BoxShape.circle, ), - SizedBox(width: 4), - Expanded( - child: Text( - primaryLanguageName ?? 'Unknown', - overflow: TextOverflow.ellipsis, - ), - ), - ]), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Icon(Octicons.star, - size: 14, color: theme.palette.text), - Text(numberFormat.format(starCount)), - ], ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Icon(Octicons.repo_forked, - size: 14, color: theme.palette.text), - Text(numberFormat.format(forkCount)), - ], + SizedBox(width: 4), + Text( + primaryLanguageName, + overflow: TextOverflow.ellipsis, ), - ), + SizedBox(width: 24), + ], + if (starCount > 0) ...[ + Icon(Octicons.star, + size: 16, color: theme.palette.text), + SizedBox(width: 2), + Text(numberFormat.format(starCount)), + SizedBox(width: 24), + ], + if (forkCount > 0) ...[ + Icon(Octicons.repo_forked, + size: 16, color: theme.palette.text), + SizedBox(width: 2), + Text(numberFormat.format(forkCount)), + ], ], ), ), - ]), + ], ), ), ],