mirror of
https://github.com/git-touch/git-touch
synced 2025-02-21 22:07:51 +01:00
improvement: commit screen style
This commit is contained in:
parent
7689ac06c6
commit
1536ec47b8
@ -488,6 +488,12 @@ class GithubCommitsQuery
|
|||||||
arguments: [],
|
arguments: [],
|
||||||
directives: [],
|
directives: [],
|
||||||
selectionSet: SelectionSetNode(selections: [
|
selectionSet: SelectionSetNode(selections: [
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: '__typename'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
InlineFragmentNode(
|
InlineFragmentNode(
|
||||||
typeCondition: TypeConditionNode(
|
typeCondition: TypeConditionNode(
|
||||||
on: NamedTypeNode(
|
on: NamedTypeNode(
|
||||||
@ -550,12 +556,6 @@ class GithubCommitsQuery
|
|||||||
selectionSet: null)
|
selectionSet: null)
|
||||||
]))
|
]))
|
||||||
])),
|
])),
|
||||||
FieldNode(
|
|
||||||
name: NameNode(value: '__typename'),
|
|
||||||
alias: null,
|
|
||||||
arguments: [],
|
|
||||||
directives: [],
|
|
||||||
selectionSet: null),
|
|
||||||
FieldNode(
|
FieldNode(
|
||||||
name: NameNode(value: 'history'),
|
name: NameNode(value: 'history'),
|
||||||
alias: null,
|
alias: null,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
fragment T on Ref {
|
fragment T on Ref {
|
||||||
target {
|
target {
|
||||||
|
__typename
|
||||||
... on Commit {
|
... on Commit {
|
||||||
oid
|
oid
|
||||||
url
|
url
|
||||||
@ -15,7 +16,6 @@ fragment T on Ref {
|
|||||||
# status {
|
# status {
|
||||||
# state
|
# state
|
||||||
# }
|
# }
|
||||||
__typename
|
|
||||||
history(first: 30, after: $after) {
|
history(first: 30, after: $after) {
|
||||||
pageInfo {
|
pageInfo {
|
||||||
hasNextPage
|
hasNextPage
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:git_touch/graphql/github_commits.dart';
|
import 'package:git_touch/graphql/github_commits.dart';
|
||||||
import 'package:git_touch/models/auth.dart';
|
import 'package:git_touch/models/auth.dart';
|
||||||
|
import 'package:git_touch/models/theme.dart';
|
||||||
import 'package:git_touch/scaffolds/list_stateful.dart';
|
import 'package:git_touch/scaffolds/list_stateful.dart';
|
||||||
import 'package:git_touch/utils/utils.dart';
|
import 'package:git_touch/utils/utils.dart';
|
||||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||||
@ -8,7 +9,6 @@ import 'package:git_touch/widgets/link.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:timeago/timeago.dart' as timeago;
|
import 'package:timeago/timeago.dart' as timeago;
|
||||||
import 'package:git_touch/widgets/avatar.dart';
|
import 'package:git_touch/widgets/avatar.dart';
|
||||||
import 'package:primer/primer.dart';
|
|
||||||
|
|
||||||
final commitsRouter = RouterScreen(
|
final commitsRouter = RouterScreen(
|
||||||
'/:owner/:name/commits',
|
'/:owner/:name/commits',
|
||||||
@ -55,6 +55,8 @@ class CommitsScreen extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final theme = Provider.of<ThemeModel>(context);
|
||||||
|
|
||||||
return ListStatefulScaffold<GithubCommitsCommit, String>(
|
return ListStatefulScaffold<GithubCommitsCommit, String>(
|
||||||
title: AppBarTitle('Commits'),
|
title: AppBarTitle('Commits'),
|
||||||
onRefresh: () => _query(context),
|
onRefresh: () => _query(context),
|
||||||
@ -67,27 +69,34 @@ class CommitsScreen extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Avatar(url: payload.author.avatarUrl),
|
Avatar(url: payload.author?.avatarUrl),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(payload.messageHeadline,
|
Text(
|
||||||
style: TextStyle(
|
payload.messageHeadline,
|
||||||
fontWeight: FontWeight.w500, fontSize: 14)),
|
style: TextStyle(
|
||||||
|
fontSize: 17,
|
||||||
|
color: theme.palette.text,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
Wrap(
|
Wrap(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
payload.author.user?.login ?? payload.author.name,
|
payload.author?.user?.login ??
|
||||||
style: TextStyle(
|
payload.author.name,
|
||||||
fontWeight: FontWeight.w500, fontSize: 14)),
|
style: TextStyle(fontSize: 15)),
|
||||||
Text(
|
Text(
|
||||||
' committed ' +
|
' committed ${timeago.format(payload.committedDate)}',
|
||||||
timeago.format(payload.committedDate),
|
style: TextStyle(
|
||||||
style: TextStyle(
|
color: theme.palette.secondaryText,
|
||||||
color: PrimerColors.gray600, fontSize: 14)),
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
// if (payload['status'] != null) ...[
|
// if (payload['status'] != null) ...[
|
||||||
// SizedBox(width: 4),
|
// SizedBox(width: 4),
|
||||||
// _buildStatus(payload['status']['state'])
|
// _buildStatus(payload['status']['state'])
|
||||||
|
@ -72,8 +72,6 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
actionBuilder: (data, setState) {
|
actionBuilder: (data, setState) {
|
||||||
final repo = data.item1;
|
final repo = data.item1;
|
||||||
final ref = branch == null ? repo.defaultBranchRef : repo.ref;
|
|
||||||
|
|
||||||
return ActionButton(
|
return ActionButton(
|
||||||
title: 'Repository Actions',
|
title: 'Repository Actions',
|
||||||
items: [
|
items: [
|
||||||
@ -95,11 +93,6 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
// setState(() {});
|
// setState(() {});
|
||||||
// },
|
// },
|
||||||
// ),
|
// ),
|
||||||
ActionItem(
|
|
||||||
text:
|
|
||||||
'Commits (${(ref.target as GithubRepositoryCommit).history?.totalCount})',
|
|
||||||
url: '/$owner/$name/commits',
|
|
||||||
),
|
|
||||||
ActionItem(
|
ActionItem(
|
||||||
text: 'Projects (${repo.projects.totalCount})',
|
text: 'Projects (${repo.projects.totalCount})',
|
||||||
url: repo.projectsUrl,
|
url: repo.projectsUrl,
|
||||||
@ -336,6 +329,15 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
Text(numberFormat.format(repo.pullRequests.totalCount)),
|
Text(numberFormat.format(repo.pullRequests.totalCount)),
|
||||||
url: '/$owner/$name/pulls',
|
url: '/$owner/$name/pulls',
|
||||||
),
|
),
|
||||||
|
TableViewItem(
|
||||||
|
leftIconData: Octicons.history,
|
||||||
|
text: Text('Commits'),
|
||||||
|
rightWidget: Text((ref.target as GithubRepositoryCommit)
|
||||||
|
.history
|
||||||
|
?.totalCount
|
||||||
|
.toString()),
|
||||||
|
url: '/$owner/$name/commits',
|
||||||
|
),
|
||||||
if (ref != null) ...[
|
if (ref != null) ...[
|
||||||
if (repo.refs != null)
|
if (repo.refs != null)
|
||||||
TableViewItem(
|
TableViewItem(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user