From a3619ba340cfcd356906eec58ad7929a4d56e4e4 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Sat, 3 Oct 2020 14:26:01 +0800 Subject: [PATCH] fix(gh): trending user has no repo --- lib/screens/gh_trending.dart | 44 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/screens/gh_trending.dart b/lib/screens/gh_trending.dart index 4e70620..b0c19e4 100644 --- a/lib/screens/gh_trending.dart +++ b/lib/screens/gh_trending.dart @@ -50,28 +50,30 @@ class GhTrendingScreen extends StatelessWidget { login: v.username, // name: v.name, avatarUrl: v.avatar, - bio: Link( - url: '/github/${v.username}/${v.repo.name}', - child: Row( - children: [ - Icon( - Octicons.repo, - size: 17, - color: theme.palette.secondaryText, - ), - SizedBox(width: 4), - Expanded( - child: Text( - '${v.username} / ${v.repo.name}', - style: TextStyle( - fontSize: 17, - color: theme.palette.secondaryText, + bio: v.repo == null + ? null + : Link( + url: '/github/${v.username}/${v.repo.name}', + child: Row( + children: [ + Icon( + Octicons.repo, + size: 17, + color: theme.palette.secondaryText, + ), + SizedBox(width: 4), + Expanded( + child: Text( + '${v.username} / ${v.repo.name}', + style: TextStyle( + fontSize: 17, + color: theme.palette.secondaryText, + ), + overflow: TextOverflow.ellipsis, + )) + ], ), - overflow: TextOverflow.ellipsis, - )) - ], - ), - ), + ), ) ], ),