11import 'package:flutter/material.dart' ;
22import 'package:gsy_github_app_flutter/common/model/User.dart' ;
33import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart' ;
4+ import 'package:gsy_github_app_flutter/common/utils/NavigatorUtils.dart' ;
45import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart' ;
56import 'package:gsy_github_app_flutter/widget/GSYIConText.dart' ;
67
@@ -13,10 +14,13 @@ class UserHeaderItem extends StatelessWidget {
1314
1415 UserHeaderItem (this .userInfo);
1516
16- _getBottomItem (String title, var value) {
17+ _getBottomItem (String title, var value, onPressed ) {
1718 return new Expanded (
1819 child: new Center (
19- child: new Text (title + "\n " + (value == null ? "" : value.toString ()), textAlign: TextAlign .center, style: GSYConstant .subSmallText),
20+ child: new FlatButton (
21+ onPressed: onPressed,
22+ child: new Text (title + "\n " + (value == null ? "" : value.toString ()), textAlign: TextAlign .center, style: GSYConstant .subSmallText),
23+ ),
2024 ),
2125 );
2226 }
@@ -101,15 +105,37 @@ class UserHeaderItem extends StatelessWidget {
101105 new Row (
102106 crossAxisAlignment: CrossAxisAlignment .start,
103107 children: < Widget > [
104- _getBottomItem (GSYStrings .user_tab_repos, userInfo.public_repos),
108+ _getBottomItem (
109+ GSYStrings .user_tab_repos,
110+ userInfo.public_repos,
111+ () {
112+ NavigatorUtils .gotoCommonList (context, userInfo.login, "repository" , "user_repos" , userName: userInfo.login);
113+ },
114+ ),
105115 new Container (width: 0.3 , height: 40.0 , color: Color (GSYColors .subLightTextColor)),
106- _getBottomItem (GSYStrings .user_tab_fans, userInfo.followers),
116+ _getBottomItem (
117+ GSYStrings .user_tab_fans,
118+ userInfo.followers,
119+ () {},
120+ ),
107121 new Container (width: 0.3 , height: 40.0 , color: Color (GSYColors .subLightTextColor)),
108- _getBottomItem (GSYStrings .user_tab_focus, userInfo.following),
122+ _getBottomItem (
123+ GSYStrings .user_tab_focus,
124+ userInfo.following,
125+ () {},
126+ ),
109127 new Container (width: 0.3 , height: 40.0 , color: Color (GSYColors .subLightTextColor)),
110- _getBottomItem (GSYStrings .user_tab_star, "---" ),
128+ _getBottomItem (
129+ GSYStrings .user_tab_star,
130+ "---" ,
131+ () {},
132+ ),
111133 new Container (width: 0.3 , height: 40.0 , color: Color (GSYColors .subLightTextColor)),
112- _getBottomItem (GSYStrings .user_tab_honor, "---" ),
134+ _getBottomItem (
135+ GSYStrings .user_tab_honor,
136+ "---" ,
137+ () {},
138+ ),
113139 ],
114140 ),
115141 ],
0 commit comments