File tree 3 files changed +18
-4
lines changed
3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 1
1
import 'dart:convert' ;
2
-
3
2
import 'package:filesize/filesize.dart' ;
4
3
import 'package:flutter/material.dart' ;
5
4
import 'package:flutter/cupertino.dart' ;
@@ -76,6 +75,9 @@ class RepositoryScreen extends StatelessWidget {
76
75
pullRequests(states: OPEN) {
77
76
totalCount
78
77
}
78
+ releases {
79
+ totalCount
80
+ }
79
81
languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
80
82
totalSize
81
83
edges {
@@ -310,6 +312,14 @@ class RepositoryScreen extends StatelessWidget {
310
312
},
311
313
),
312
314
],
315
+ if ((payload['releases' ]['totalCount' ] as int ) > 0 )
316
+ TableViewItem (
317
+ leftIconData: Octicons .tag,
318
+ text: Text ('Releases' ),
319
+ rightWidget: Text (
320
+ (payload['releases' ]['totalCount' ] as int ).toString ()),
321
+ url: payload['url' ] + '/releases' ,
322
+ ),
313
323
TableViewItem (
314
324
leftIconData: Octicons .law,
315
325
text: Text ('License' ),
Original file line number Diff line number Diff line change 1
1
import 'dart:io' ;
2
-
3
2
import 'package:flutter/material.dart' ;
4
3
import 'package:flutter/cupertino.dart' ;
5
4
import 'package:flutter/gestures.dart' ;
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class TableViewItem {
28
28
final Widget leftWidget;
29
29
final Widget rightWidget;
30
30
final void Function () onTap;
31
+ final String url;
31
32
final WidgetBuilder screenBuilder;
32
33
final bool hideRightChevron;
33
34
@@ -37,6 +38,7 @@ class TableViewItem {
37
38
this .leftWidget,
38
39
this .rightWidget,
39
40
this .onTap,
41
+ this .url,
40
42
this .screenBuilder,
41
43
this .hideRightChevron = false ,
42
44
}) : assert (leftIconData == null || leftWidget == null );
@@ -86,7 +88,9 @@ class TableView extends StatelessWidget {
86
88
),
87
89
SizedBox (width: 6 )
88
90
],
89
- if ((item.onTap != null || item.screenBuilder != null ) &&
91
+ if ((item.onTap != null ||
92
+ item.screenBuilder != null ||
93
+ item.url != null ) &&
90
94
! item.hideRightChevron)
91
95
Icon (CupertinoIcons .right_chevron,
92
96
size: 20 , color: PrimerColors .gray300)
@@ -98,12 +102,13 @@ class TableView extends StatelessWidget {
98
102
),
99
103
);
100
104
101
- if (item.onTap == null && item.screenBuilder == null ) {
105
+ if (item.onTap == null && item.screenBuilder == null && item.url == null ) {
102
106
return widget;
103
107
}
104
108
return Link (
105
109
onTap: item.onTap,
106
110
screenBuilder: item.screenBuilder,
111
+ url: item.url,
107
112
child: widget,
108
113
);
109
114
}
You can’t perform that action at this time.
0 commit comments