mirror of
https://github.com/git-touch/git-touch
synced 2025-01-31 08:04:51 +01:00
improvement: add note
This commit is contained in:
parent
c6822c4830
commit
22fe55d9e0
@ -2511,6 +2511,9 @@ class GhReposRepository extends GhReposPinnableItem
|
||||
@override
|
||||
bool isFork;
|
||||
|
||||
@override
|
||||
DateTime updatedAt;
|
||||
|
||||
@override
|
||||
GhReposStargazerConnection stargazers;
|
||||
|
||||
@ -2529,6 +2532,7 @@ class GhReposRepository extends GhReposPinnableItem
|
||||
description,
|
||||
isPrivate,
|
||||
isFork,
|
||||
updatedAt,
|
||||
stargazers,
|
||||
forks,
|
||||
primaryLanguage,
|
||||
@ -2708,12 +2712,14 @@ class GhReposRepositoryInfo with EquatableMixin {
|
||||
|
||||
bool isFork;
|
||||
|
||||
DateTime updatedAt;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props =>
|
||||
[owner, name, description, isPrivate, isFork, resolveType];
|
||||
[owner, name, description, isPrivate, isFork, updatedAt, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhReposRepositoryInfoToJson(this);
|
||||
}
|
||||
|
||||
@ -3051,6 +3057,12 @@ class GhReposQuery extends GraphQLQuery<GhRepos, GhReposArguments> {
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'updatedAt'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'stargazers'),
|
||||
alias: null,
|
||||
@ -3205,6 +3217,12 @@ class GhReposQuery extends GraphQLQuery<GhRepos, GhReposArguments> {
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'updatedAt'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'stargazers'),
|
||||
alias: null,
|
||||
@ -3379,6 +3397,12 @@ class GhReposQuery extends GraphQLQuery<GhRepos, GhReposArguments> {
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'updatedAt'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'stargazers'),
|
||||
alias: null,
|
||||
|
@ -1035,6 +1035,9 @@ GhReposRepository _$GhReposRepositoryFromJson(Map<String, dynamic> json) {
|
||||
..description = json['description'] as String
|
||||
..isPrivate = json['isPrivate'] as bool
|
||||
..isFork = json['isFork'] as bool
|
||||
..updatedAt = json['updatedAt'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updatedAt'] as String)
|
||||
..stargazers = json['stargazers'] == null
|
||||
? null
|
||||
: GhReposStargazerConnection.fromJson(
|
||||
@ -1057,6 +1060,7 @@ Map<String, dynamic> _$GhReposRepositoryToJson(GhReposRepository instance) =>
|
||||
'description': instance.description,
|
||||
'isPrivate': instance.isPrivate,
|
||||
'isFork': instance.isFork,
|
||||
'updatedAt': instance.updatedAt?.toIso8601String(),
|
||||
'stargazers': instance.stargazers?.toJson(),
|
||||
'forks': instance.forks?.toJson(),
|
||||
'primaryLanguage': instance.primaryLanguage?.toJson(),
|
||||
@ -1186,6 +1190,9 @@ GhReposRepositoryInfo _$GhReposRepositoryInfoFromJson(
|
||||
..description = json['description'] as String
|
||||
..isPrivate = json['isPrivate'] as bool
|
||||
..isFork = json['isFork'] as bool
|
||||
..updatedAt = json['updatedAt'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updatedAt'] as String)
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
@ -1197,6 +1204,7 @@ Map<String, dynamic> _$GhReposRepositoryInfoToJson(
|
||||
'description': instance.description,
|
||||
'isPrivate': instance.isPrivate,
|
||||
'isFork': instance.isFork,
|
||||
'updatedAt': instance.updatedAt?.toIso8601String(),
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
|
@ -23,6 +23,7 @@ query GhRepos($owner: String!, $after: String, $isStar: Boolean!) {
|
||||
description
|
||||
isPrivate
|
||||
isFork
|
||||
updatedAt
|
||||
stargazers {
|
||||
totalCount
|
||||
}
|
||||
@ -53,6 +54,7 @@ query GhRepos($owner: String!, $after: String, $isStar: Boolean!) {
|
||||
description
|
||||
isPrivate
|
||||
isFork
|
||||
updatedAt
|
||||
stargazers {
|
||||
totalCount
|
||||
}
|
||||
@ -84,6 +86,7 @@ query GhRepos($owner: String!, $after: String, $isStar: Boolean!) {
|
||||
description
|
||||
isPrivate
|
||||
isFork
|
||||
updatedAt
|
||||
stargazers {
|
||||
totalCount
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ class GiteaUserScreen extends StatelessWidget {
|
||||
v.forksCount,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
|
@ -67,7 +67,7 @@ class GitlabProjectScreen extends StatelessWidget {
|
||||
data.starCount,
|
||||
data.forksCount,
|
||||
data.languages.keys.first,
|
||||
null,
|
||||
null, null,
|
||||
),
|
||||
CommonStyle.border,
|
||||
Row(
|
||||
|
@ -72,6 +72,7 @@ class GitlabUserScreen extends StatelessWidget {
|
||||
v.forksCount,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
|
@ -6,6 +6,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/widgets/repository_item.dart';
|
||||
import 'package:timeago/timeago.dart' as timeago;
|
||||
|
||||
class RepositoriesScreen extends StatelessWidget {
|
||||
final String owner;
|
||||
@ -72,6 +73,7 @@ class RepositoriesScreen extends StatelessWidget {
|
||||
item.forks.totalCount,
|
||||
item.primaryLanguage?.name,
|
||||
item.primaryLanguage?.color,
|
||||
'Updated ${timeago.format(item.updatedAt)}',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -2,14 +2,15 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/common.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/issue_item.dart';
|
||||
import 'package:git_touch/widgets/loading.dart';
|
||||
import 'package:git_touch/widgets/user_item.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import '../utils/utils.dart';
|
||||
import 'package:git_touch/widgets/repository_item.dart';
|
||||
import 'package:timeago/timeago.dart' as timeago;
|
||||
|
||||
class SearchScreen extends StatefulWidget {
|
||||
@override
|
||||
@ -59,6 +60,7 @@ class _SearchScreenState extends State<SearchScreen> {
|
||||
description
|
||||
isPrivate
|
||||
isFork
|
||||
updatedAt
|
||||
stargazers {
|
||||
totalCount
|
||||
}
|
||||
@ -162,6 +164,7 @@ class _SearchScreenState extends State<SearchScreen> {
|
||||
Widget _buildItem(p) {
|
||||
switch (_activeTab) {
|
||||
case 0:
|
||||
final updatedAt = timeago.format(DateTime.parse(p['updatedAt']));
|
||||
return RepositoryItem(
|
||||
p['owner']['login'],
|
||||
p['owner']['avatarUrl'],
|
||||
@ -172,6 +175,7 @@ class _SearchScreenState extends State<SearchScreen> {
|
||||
p['forks']['totalCount'],
|
||||
p['primaryLanguage'] == null ? null : p['primaryLanguage']['name'],
|
||||
p['primaryLanguage'] == null ? null : p['primaryLanguage']['color'],
|
||||
'Updated $updatedAt',
|
||||
);
|
||||
case 1:
|
||||
return UserItem(
|
||||
|
@ -38,6 +38,7 @@ class TrendingScreen extends StatelessWidget {
|
||||
item.forks ?? 0,
|
||||
item.language,
|
||||
item.languageColor,
|
||||
'${item.currentPeriodStars} stars today',
|
||||
);
|
||||
case 1:
|
||||
final item = GithubTrendingUser.fromJson(v);
|
||||
|
@ -15,6 +15,7 @@ import 'package:git_touch/widgets/text_contains_organization.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/widgets/action_button.dart';
|
||||
import 'package:timeago/timeago.dart' as t;
|
||||
|
||||
final userRouter = RouterScreen(
|
||||
'/:login',
|
||||
@ -74,6 +75,7 @@ class UserScreen extends StatelessWidget {
|
||||
v.forks.totalCount,
|
||||
v.primaryLanguage?.name,
|
||||
v.primaryLanguage?.color,
|
||||
null,
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
|
@ -16,6 +16,7 @@ class RepositoryItem extends StatelessWidget {
|
||||
final int forkCount;
|
||||
final String primaryLanguageName;
|
||||
final String primaryLanguageColor;
|
||||
final String note;
|
||||
|
||||
RepositoryItem(
|
||||
this.owner,
|
||||
@ -27,6 +28,7 @@ class RepositoryItem extends StatelessWidget {
|
||||
this.forkCount,
|
||||
this.primaryLanguageName,
|
||||
this.primaryLanguageColor,
|
||||
this.note,
|
||||
);
|
||||
|
||||
@override
|
||||
@ -44,7 +46,6 @@ class RepositoryItem extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Avatar(
|
||||
url: avatarUrl,
|
||||
@ -80,7 +81,7 @@ class RepositoryItem extends StatelessWidget {
|
||||
// size: 17, color: theme.palette.tertiaryText),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 6),
|
||||
SizedBox(height: 8),
|
||||
if (description != null && description.isNotEmpty) ...[
|
||||
Text(
|
||||
description,
|
||||
@ -91,6 +92,16 @@ class RepositoryItem extends StatelessWidget {
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
if (note != null) ...[
|
||||
Text(
|
||||
note,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.palette.tertiaryText,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
DefaultTextStyle(
|
||||
style: TextStyle(color: theme.palette.text, fontSize: 14),
|
||||
child: Row(
|
||||
|
Loading…
x
Reference in New Issue
Block a user