mirror of
https://github.com/git-touch/git-touch
synced 2025-02-20 13:30:38 +01:00
feat: add issue, pull request and commit entry
This commit is contained in:
parent
03ab9c9bed
commit
08e7c99c64
@ -20,6 +20,7 @@ class CommitsScreen extends StatelessWidget {
|
||||
if (cursor != null) {
|
||||
params += ', after: "$cursor"';
|
||||
}
|
||||
// TODO: Specify branch
|
||||
var data = await Provider.of<SettingsModel>(context).query('''
|
||||
{
|
||||
repository(owner: "$owner", name: "$name") {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'package:filesize/filesize.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/models/settings.dart';
|
||||
@ -95,6 +96,10 @@ class RepoScreen extends StatelessWidget {
|
||||
text
|
||||
}
|
||||
}
|
||||
licenseInfo {
|
||||
name
|
||||
nickname
|
||||
}
|
||||
}
|
||||
}
|
||||
''');
|
||||
@ -218,13 +223,78 @@ class RepoScreen extends StatelessWidget {
|
||||
text: Text(payload['primaryLanguage'] == null
|
||||
? 'Unknown'
|
||||
: payload['primaryLanguage']['name']),
|
||||
rightWidget: Icon(
|
||||
CupertinoIcons.right_chevron,
|
||||
size: 18,
|
||||
color: PrimerColors.gray300,
|
||||
rightWidget: Row(
|
||||
children: <Widget>[
|
||||
Text(filesize(payload['languages']['totalSize'] as int)),
|
||||
Icon(
|
||||
CupertinoIcons.right_chevron,
|
||||
size: 18,
|
||||
color: PrimerColors.gray300,
|
||||
),
|
||||
],
|
||||
),
|
||||
screenBuilder: (_) => ObjectScreen(owner: owner, name: name),
|
||||
)
|
||||
),
|
||||
TableViewItem(
|
||||
leftWidget: Icon(Octicons.issue_opened, size: 20),
|
||||
text: Text('Issues'),
|
||||
rightWidget: Row(
|
||||
children: <Widget>[
|
||||
Text(payload['issues']['totalCount'].toString()),
|
||||
Icon(
|
||||
CupertinoIcons.right_chevron,
|
||||
size: 18,
|
||||
color: PrimerColors.gray300,
|
||||
),
|
||||
],
|
||||
),
|
||||
screenBuilder: (_) => IssuesScreen(owner: owner, name: name),
|
||||
),
|
||||
TableViewItem(
|
||||
leftWidget: Icon(Octicons.git_pull_request, size: 20),
|
||||
text: Text('Pull requests'),
|
||||
rightWidget: Row(
|
||||
children: <Widget>[
|
||||
Text(payload['pullRequests']['totalCount'].toString()),
|
||||
Icon(
|
||||
CupertinoIcons.right_chevron,
|
||||
size: 18,
|
||||
color: PrimerColors.gray300,
|
||||
),
|
||||
],
|
||||
),
|
||||
screenBuilder: (_) =>
|
||||
IssuesScreen(owner: owner, name: name, isPullRequest: true),
|
||||
),
|
||||
]),
|
||||
BorderView(height: 10),
|
||||
TableView(items: [
|
||||
TableViewItem(
|
||||
leftWidget: Icon(Octicons.law, size: 20),
|
||||
text: Text('License'),
|
||||
rightWidget: Text(payload['licenseInfo'] == null
|
||||
? 'Unknown'
|
||||
: (payload['licenseInfo']['nickname'] ??
|
||||
payload['licenseInfo']['name'])
|
||||
.toString()),
|
||||
),
|
||||
TableViewItem(
|
||||
leftWidget: Icon(Octicons.history, size: 20),
|
||||
text: Text('Commits'),
|
||||
rightWidget: Row(
|
||||
children: <Widget>[
|
||||
Text(payload['defaultBranchRef']['target']['history']
|
||||
['totalCount']
|
||||
.toString()),
|
||||
Icon(
|
||||
CupertinoIcons.right_chevron,
|
||||
size: 18,
|
||||
color: PrimerColors.gray300,
|
||||
),
|
||||
],
|
||||
),
|
||||
screenBuilder: (_) => CommitsScreen(owner, name),
|
||||
),
|
||||
]),
|
||||
BorderView(height: 10),
|
||||
if (payload['object'] != null)
|
||||
|
@ -33,6 +33,7 @@ dependencies:
|
||||
timeago: ^2.0.18
|
||||
provider: ^3.1.0
|
||||
seti: ^0.2.0
|
||||
filesize: ^1.0.4
|
||||
primer:
|
||||
git:
|
||||
url: git://github.com/pd4d10/primer-flutter
|
||||
|
Loading…
x
Reference in New Issue
Block a user