mirror of
https://github.com/git-touch/git-touch
synced 2025-03-07 20:57:44 +01:00
improvement: repository screen header
This commit is contained in:
parent
d2ae236356
commit
b5933dd895
@ -46,6 +46,9 @@ class GithubRepositoryRepository extends GithubRepositoryPinnableItem
|
||||
@override
|
||||
String description;
|
||||
|
||||
@override
|
||||
String homepageUrl;
|
||||
|
||||
@override
|
||||
bool isPrivate;
|
||||
|
||||
@ -109,6 +112,7 @@ class GithubRepositoryRepository extends GithubRepositoryPinnableItem
|
||||
owner,
|
||||
name,
|
||||
description,
|
||||
homepageUrl,
|
||||
isPrivate,
|
||||
isFork,
|
||||
stargazers,
|
||||
@ -667,6 +671,8 @@ class GithubRepositoryRepositoryInfo with EquatableMixin {
|
||||
|
||||
String description;
|
||||
|
||||
String homepageUrl;
|
||||
|
||||
bool isPrivate;
|
||||
|
||||
bool isFork;
|
||||
@ -685,6 +691,7 @@ class GithubRepositoryRepositoryInfo with EquatableMixin {
|
||||
owner,
|
||||
name,
|
||||
description,
|
||||
homepageUrl,
|
||||
isPrivate,
|
||||
isFork,
|
||||
hasIssuesEnabled,
|
||||
@ -803,6 +810,12 @@ class GithubRepositoryQuery
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'homepageUrl'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'isPrivate'),
|
||||
alias: null,
|
||||
@ -1205,7 +1218,7 @@ class GithubRepositoryQuery
|
||||
arguments: [
|
||||
ArgumentNode(
|
||||
name: NameNode(value: 'first'),
|
||||
value: IntValueNode(value: '100'))
|
||||
value: IntValueNode(value: '10'))
|
||||
],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
|
@ -28,6 +28,7 @@ GithubRepositoryRepository _$GithubRepositoryRepositoryFromJson(
|
||||
json['owner'] as Map<String, dynamic>)
|
||||
..name = json['name'] as String
|
||||
..description = json['description'] as String
|
||||
..homepageUrl = json['homepageUrl'] as String
|
||||
..isPrivate = json['isPrivate'] as bool
|
||||
..isFork = json['isFork'] as bool
|
||||
..stargazers = json['stargazers'] == null
|
||||
@ -79,6 +80,7 @@ Map<String, dynamic> _$GithubRepositoryRepositoryToJson(
|
||||
'owner': instance.owner?.toJson(),
|
||||
'name': instance.name,
|
||||
'description': instance.description,
|
||||
'homepageUrl': instance.homepageUrl,
|
||||
'isPrivate': instance.isPrivate,
|
||||
'isFork': instance.isFork,
|
||||
'stargazers': instance.stargazers?.toJson(),
|
||||
@ -523,6 +525,7 @@ GithubRepositoryRepositoryInfo _$GithubRepositoryRepositoryInfoFromJson(
|
||||
json['owner'] as Map<String, dynamic>)
|
||||
..name = json['name'] as String
|
||||
..description = json['description'] as String
|
||||
..homepageUrl = json['homepageUrl'] as String
|
||||
..isPrivate = json['isPrivate'] as bool
|
||||
..isFork = json['isFork'] as bool
|
||||
..hasIssuesEnabled = json['hasIssuesEnabled'] as bool
|
||||
@ -540,6 +543,7 @@ Map<String, dynamic> _$GithubRepositoryRepositoryInfoToJson(
|
||||
'owner': instance.owner?.toJson(),
|
||||
'name': instance.name,
|
||||
'description': instance.description,
|
||||
'homepageUrl': instance.homepageUrl,
|
||||
'isPrivate': instance.isPrivate,
|
||||
'isFork': instance.isFork,
|
||||
'hasIssuesEnabled': instance.hasIssuesEnabled,
|
||||
|
@ -12,6 +12,7 @@ query(
|
||||
}
|
||||
name
|
||||
description
|
||||
homepageUrl
|
||||
isPrivate
|
||||
isFork
|
||||
stargazers {
|
||||
@ -88,7 +89,7 @@ query(
|
||||
name
|
||||
spdxId
|
||||
}
|
||||
repositoryTopics(first: 100) {
|
||||
repositoryTopics(first: 10) {
|
||||
nodes {
|
||||
url
|
||||
topic {
|
||||
|
@ -7,11 +7,13 @@ import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/avatar.dart';
|
||||
import 'package:git_touch/widgets/link.dart';
|
||||
import 'package:git_touch/widgets/markdown_view.dart';
|
||||
import 'package:git_touch/widgets/table_view.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/widgets/repository_item.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
import '../widgets/entry_item.dart';
|
||||
import 'package:git_touch/widgets/action_button.dart';
|
||||
@ -128,18 +130,73 @@ class RepositoryScreen extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
RepositoryItem.raw(
|
||||
repo.owner.login,
|
||||
repo.owner.avatarUrl,
|
||||
repo.name,
|
||||
repo.description,
|
||||
Octicons.repo, // TODO:
|
||||
repo.stargazers.totalCount,
|
||||
repo.forks.totalCount,
|
||||
repo.primaryLanguage?.name,
|
||||
repo.primaryLanguage?.color,
|
||||
repo.repositoryTopics.nodes,
|
||||
inRepoScreen: true),
|
||||
Container(
|
||||
padding: CommonStyle.padding,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: join(SizedBox(height: 12), [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
GithubAvatar(
|
||||
url: repo.owner.avatarUrl,
|
||||
size: AvatarSize.small,
|
||||
login: owner),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'$owner / $name',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: theme.palette.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (repo.description != null && repo.description.isNotEmpty)
|
||||
Text(
|
||||
repo.description,
|
||||
style: TextStyle(
|
||||
color: theme.palette.secondaryText,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
if (repo.homepageUrl != null && repo.homepageUrl.isNotEmpty)
|
||||
Link(
|
||||
url: repo.homepageUrl,
|
||||
child: Text(
|
||||
repo.homepageUrl,
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (repo.repositoryTopics.nodes.isNotEmpty)
|
||||
// TODO: link
|
||||
Wrap(
|
||||
spacing: 4,
|
||||
runSpacing: 4,
|
||||
children: repo.repositoryTopics.nodes.map((node) {
|
||||
return Container(
|
||||
padding:
|
||||
EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: PrimerColors.blue000,
|
||||
borderRadius: BorderRadius.all(Radius.circular(4)),
|
||||
),
|
||||
child: Text(
|
||||
node.topic.name,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: theme.palette.primary,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
CommonStyle.border,
|
||||
Row(
|
||||
children: <Widget>[
|
||||
|
@ -26,13 +26,6 @@ class UserItem extends StatelessWidget {
|
||||
this.bio,
|
||||
this.inUserScreen = false,
|
||||
});
|
||||
UserItem.fromData(
|
||||
data, {
|
||||
this.inUserScreen = false,
|
||||
}) : login = data['login'],
|
||||
name = data['name'],
|
||||
avatarUrl = data['avatarUrl'],
|
||||
bio = Text(data['bio']);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user