fix(github): cross reference event

This commit is contained in:
Rongjian Zhang 2020-10-08 14:30:13 +08:00
parent 85d5cadbeb
commit 0d722f062e
1 changed files with 9 additions and 2 deletions

View File

@ -103,12 +103,19 @@ class TimelineItem extends StatelessWidget {
case 'IssueComment':
return CommentItem.gh(p);
case 'CrossReferencedEvent':
final number = p['source']['number'] as int;
final owner = p['source']['repository']['owner']['login'] as String;
final name = p['source']['repository']['name'] as String;
final prefix = p['source']['__typename'] == 'Issue' ? 'issues' : 'pull';
return TimelineEventItem(
actor: p['actor']['login'],
iconData: Octicons.primitive_dot,
iconColor: GithubPalette.open,
textSpan: TextSpan(
text: ' referenced this on #' + p['source']['number'].toString()),
textSpan: TextSpan(children: [
TextSpan(text: ' referenced this on '),
createLinkSpan(context, '$owner/$name#$number',
'/github/$owner/$name/$prefix/$number'),
]),
p: p,
);
case 'ClosedEvent':