From f4ad7c33b84323b5914a5106845fe8bb2251e568 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Sat, 8 Feb 2020 15:11:17 +0800 Subject: [PATCH] improvement(gh): add trending user repo link --- lib/screens/gh_trending.dart | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lib/screens/gh_trending.dart b/lib/screens/gh_trending.dart index 94f0d91..3937025 100644 --- a/lib/screens/gh_trending.dart +++ b/lib/screens/gh_trending.dart @@ -5,6 +5,7 @@ import 'package:git_touch/models/theme.dart'; import 'package:git_touch/scaffolds/tab_stateful.dart'; import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/widgets/app_bar_title.dart'; +import 'package:git_touch/widgets/link.dart'; import 'package:git_touch/widgets/user_item.dart'; import 'package:http/http.dart' as http; import 'package:git_touch/widgets/repository_item.dart'; @@ -50,16 +51,25 @@ class GhTrendingScreen extends StatelessWidget { login: item.username, // name: item.name, avatarUrl: item.avatar, - bio: Row( - children: [ - Icon( - Octicons.repo, - size: 15, - color: theme.palette.secondaryText, - ), - SizedBox(width: 2), - Text(item.repo.name) - ], + bio: Link( + url: '/${item.username}/${item.repo.name}', + child: Row( + children: [ + Icon( + Octicons.repo, + size: 17, + color: theme.palette.secondaryText, + ), + SizedBox(width: 4), + Text( + '${item.username} / ${item.repo.name}', + style: TextStyle( + fontSize: 17, + color: theme.palette.secondaryText, + ), + ) + ], + ), ), ); default: