1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:flutter/cupertino.dart' ;
3
- import 'package:url_launcher/url_launcher .dart' ;
3
+ import 'package:git_touch/screens/repo .dart' ;
4
4
import 'package:timeago/timeago.dart' as timeago;
5
5
import 'package:primer/primer.dart' ;
6
6
import '../screens/issue.dart' ;
@@ -59,6 +59,7 @@ class EventItem extends StatelessWidget {
59
59
Widget detailWidget,
60
60
IconData iconData = Octicons .octoface,
61
61
WidgetBuilder screenBuilder,
62
+ String url,
62
63
}) {
63
64
if (detailWidget == null && detail != null ) {
64
65
detailWidget =
@@ -67,6 +68,7 @@ class EventItem extends StatelessWidget {
67
68
68
69
return Link (
69
70
screenBuilder: screenBuilder,
71
+ url: url,
70
72
child: Container (
71
73
padding: EdgeInsets .all (10 ),
72
74
child: Column (
@@ -84,7 +86,7 @@ class EventItem extends StatelessWidget {
84
86
Expanded (
85
87
child: Column (
86
88
crossAxisAlignment: CrossAxisAlignment .start,
87
- children: join (SizedBox (height: 6 ), [
89
+ children: join (SizedBox (height: 8 ), [
88
90
RichText (
89
91
text: TextSpan (
90
92
style: TextStyle (
@@ -170,6 +172,9 @@ class EventItem extends StatelessWidget {
170
172
_buildRepo (context),
171
173
],
172
174
iconData: Octicons .repo_forked,
175
+ screenBuilder: (_) => RepoScreen (
176
+ event.payload['forkee' ]['owner' ]['login' ],
177
+ event.payload['forkee' ]['name' ]),
173
178
);
174
179
case 'ForkApplyEvent' :
175
180
case 'GitHubAppAuthorizationEvent' :
@@ -298,40 +303,36 @@ class EventItem extends StatelessWidget {
298
303
_buildRepo (context)
299
304
],
300
305
iconData: Octicons .repo_push,
301
- detailWidget: Link (
302
- onTap: () {
303
- launch ('https://github.com/' +
304
- event.repoFullName +
305
- '/compare/' +
306
- event.payload['before' ] +
307
- '...' +
308
- event.payload['head' ]);
309
- },
310
- child: Column (
311
- children: commits.map ((commit) {
312
- return Row (children: < Widget > [
313
- Text (
314
- (commit['sha' ] as String ).substring (0 , 7 ),
315
- style: TextStyle (
316
- color: PrimerColors .blue500,
317
- fontSize: 13 ,
318
- fontFamily: 'Menlo' ,
319
- fontFamilyFallback: ['Menlo' , 'Roboto Mono' ],
320
- ),
306
+ detailWidget: Column (
307
+ children: commits.map ((commit) {
308
+ return Row (children: < Widget > [
309
+ Text (
310
+ (commit['sha' ] as String ).substring (0 , 7 ),
311
+ style: TextStyle (
312
+ color: PrimerColors .blue500,
313
+ fontSize: 13 ,
314
+ fontFamily: 'Menlo' ,
315
+ fontFamilyFallback: ['Menlo' , 'Roboto Mono' ],
321
316
),
322
- SizedBox (width : 6 ),
323
- Expanded (
324
- child : Text (
325
- commit[ 'message' ],
326
- style : TextStyle (color : Colors .black54, fontSize : 14 ) ,
327
- overflow : TextOverflow .ellipsis ,
328
- maxLines : 1 ,
329
- ) ,
330
- )
331
- ]);
332
- }). toList (),
333
- ),
317
+ ),
318
+ SizedBox (width : 6 ),
319
+ Expanded (
320
+ child : Text (
321
+ commit[ 'message' ] ,
322
+ style : TextStyle (color : Colors .black54, fontSize : 14 ) ,
323
+ overflow : TextOverflow .ellipsis ,
324
+ maxLines : 1 ,
325
+ ),
326
+ )
327
+ ]);
328
+ }). toList ( ),
334
329
),
330
+ url: 'https://github.com/' +
331
+ event.repoFullName +
332
+ '/compare/' +
333
+ event.payload['before' ] +
334
+ '...' +
335
+ event.payload['head' ],
335
336
);
336
337
case 'ReleaseEvent' :
337
338
case 'RepositoryEvent' :
@@ -348,6 +349,7 @@ class EventItem extends StatelessWidget {
348
349
context: context,
349
350
spans: [TextSpan (text: ' starred ' ), _buildRepo (context)],
350
351
iconData: Octicons .star,
352
+ screenBuilder: (_) => RepoScreen .fromFullName (event.repoFullName),
351
353
);
352
354
default :
353
355
return defaultItem;
0 commit comments