@@ -43,10 +43,10 @@ class ReposHeaderItem extends StatelessWidget {
4343 @override
4444 Widget build (BuildContext context) {
4545 String createStr = reposHeaderViewModel.repositoryIsFork
46- ? "Frok at " + " " + reposHeaderViewModel.repositoryParentName + '\n '
47- : "Create at " + " " + reposHeaderViewModel.created_at + "\n " ;
46+ ? GSYStrings .repos_fork_at + reposHeaderViewModel.repositoryParentName + '\n '
47+ : GSYStrings .repos_create_at + reposHeaderViewModel.created_at + "\n " ;
4848
49- String updateStr = "Last commit at " + reposHeaderViewModel.push_at;
49+ String updateStr = GSYStrings .repos_last_commit + reposHeaderViewModel.push_at;
5050
5151 String infoText = createStr + ((reposHeaderViewModel.push_at != null ) ? updateStr : '' );
5252
@@ -112,9 +112,21 @@ class ReposHeaderItem extends StatelessWidget {
112112
113113 ///创建状态
114114 new Container (
115- child: new Text (infoText, style: GSYConstant .subLightSmallText),
116- margin: new EdgeInsets .only (top: 6.0 , bottom: 2.0 , right: 5.0 ),
117- alignment: Alignment .topRight),
115+ margin: new EdgeInsets .only (top: 6.0 , bottom: 2.0 , right: 5.0 ),
116+ alignment: Alignment .topRight,
117+ child: new RawMaterialButton (
118+ onPressed: () {
119+ if (reposHeaderViewModel.repositoryIsFork) {
120+ NavigatorUtils .goReposDetail (context, reposHeaderViewModel.repositoryParentUser, reposHeaderViewModel.repositoryName);
121+ }
122+ },
123+ materialTapTargetSize: MaterialTapTargetSize .shrinkWrap,
124+ padding: const EdgeInsets .all (0.0 ),
125+ constraints: const BoxConstraints (minWidth: 0.0 , minHeight: 0.0 ),
126+ child: new Text (infoText,
127+ style: reposHeaderViewModel.repositoryIsFork ? GSYConstant .actionLightSmallText : GSYConstant .subLightSmallText),
128+ ),
129+ ),
118130 new Divider (
119131 color: Color (GSYColors .subTextColor),
120132 ),
@@ -135,6 +147,7 @@ class ReposHeaderItem extends StatelessWidget {
135147 userName: reposHeaderViewModel.ownerName, reposName: reposHeaderViewModel.repositoryName);
136148 },
137149 ),
150+
138151 ///fork状态
139152 new Container (width: 0.3 , height: 25.0 , color: Color (GSYColors .subLightTextColor)),
140153 _getBottomItem (
@@ -145,6 +158,7 @@ class ReposHeaderItem extends StatelessWidget {
145158 userName: reposHeaderViewModel.ownerName, reposName: reposHeaderViewModel.repositoryName);
146159 },
147160 ),
161+
148162 ///订阅状态
149163 new Container (width: 0.3 , height: 25.0 , color: Color (GSYColors .subLightTextColor)),
150164 _getBottomItem (
@@ -155,6 +169,7 @@ class ReposHeaderItem extends StatelessWidget {
155169 userName: reposHeaderViewModel.ownerName, reposName: reposHeaderViewModel.repositoryName);
156170 },
157171 ),
172+
158173 ///issue状态
159174 new Container (width: 0.3 , height: 25.0 , color: Color (GSYColors .subLightTextColor)),
160175 _getBottomItem (
@@ -207,6 +222,7 @@ class ReposHeaderViewModel {
207222 String repositoryDes = "---" ;
208223 String repositoryLastActivity = "" ;
209224 String repositoryParentName = "" ;
225+ String repositoryParentUser = "" ;
210226 String created_at = "" ;
211227 String push_at = "" ;
212228 String license = "" ;
@@ -240,6 +256,7 @@ class ReposHeaderViewModel {
240256 this .repositoryIsFork = map.fork;
241257 this .license = map.license != null ? map.license.name : "" ;
242258 this .repositoryParentName = map.parent != null ? map.parent.fullName : null ;
259+ this .repositoryParentUser = map.parent != null ? map.parent.owner.login : null ;
243260 this .created_at = CommonUtils .getNewsTimeStr (map.createdAt);
244261 this .push_at = CommonUtils .getNewsTimeStr (map.pushedAt);
245262 }
0 commit comments