2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/home.dart';
|
2020-02-03 07:40:56 +01:00
|
|
|
import 'package:git_touch/screens/bb_commits.dart';
|
2021-01-06 14:17:49 +01:00
|
|
|
import 'package:git_touch/screens/bb_issue.dart';
|
|
|
|
import 'package:git_touch/screens/bb_issue_comment.dart';
|
|
|
|
import 'package:git_touch/screens/bb_issue_form.dart';
|
2020-05-17 06:20:11 +02:00
|
|
|
import 'package:git_touch/screens/bb_issues.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/bb_object.dart';
|
2020-05-17 06:20:11 +02:00
|
|
|
import 'package:git_touch/screens/bb_pulls.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/bb_repo.dart';
|
2020-02-02 11:58:05 +01:00
|
|
|
import 'package:git_touch/screens/bb_user.dart';
|
2020-02-01 06:26:14 +01:00
|
|
|
import 'package:git_touch/screens/code_theme.dart';
|
2020-11-01 16:23:03 +01:00
|
|
|
import 'package:git_touch/screens/ge_blob.dart';
|
2021-01-08 03:25:22 +01:00
|
|
|
import 'package:git_touch/screens/ge_commit.dart';
|
2020-10-17 14:46:47 +02:00
|
|
|
import 'package:git_touch/screens/ge_commits.dart';
|
2021-01-09 17:52:45 +01:00
|
|
|
import 'package:git_touch/screens/ge_contributors.dart';
|
2021-01-08 03:25:22 +01:00
|
|
|
import 'package:git_touch/screens/ge_files.dart';
|
2021-01-06 05:52:58 +01:00
|
|
|
import 'package:git_touch/screens/ge_issue.dart';
|
|
|
|
import 'package:git_touch/screens/ge_issue_comment.dart';
|
|
|
|
import 'package:git_touch/screens/ge_issue_form.dart';
|
|
|
|
import 'package:git_touch/screens/ge_issues.dart';
|
|
|
|
import 'package:git_touch/screens/ge_pulls.dart';
|
2020-10-17 13:06:11 +02:00
|
|
|
import 'package:git_touch/screens/ge_repo.dart';
|
2020-10-17 12:09:36 +02:00
|
|
|
import 'package:git_touch/screens/ge_repos.dart';
|
2020-11-01 17:32:47 +01:00
|
|
|
import 'package:git_touch/screens/ge_search.dart';
|
2020-11-01 16:16:52 +01:00
|
|
|
import 'package:git_touch/screens/ge_tree.dart';
|
2020-10-17 11:35:08 +02:00
|
|
|
import 'package:git_touch/screens/ge_user.dart';
|
2020-10-17 12:18:26 +02:00
|
|
|
import 'package:git_touch/screens/ge_users.dart';
|
2020-02-07 07:17:05 +01:00
|
|
|
import 'package:git_touch/screens/gh_commits.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/gh_compare.dart';
|
2020-04-25 12:31:32 +02:00
|
|
|
import 'package:git_touch/screens/gh_contributors.dart';
|
2020-10-04 15:04:23 +02:00
|
|
|
import 'package:git_touch/screens/gh_events.dart';
|
2020-04-30 18:04:24 +02:00
|
|
|
import 'package:git_touch/screens/gh_files.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/gh_gist_object.dart';
|
|
|
|
import 'package:git_touch/screens/gh_gists.dart';
|
2020-05-14 07:28:12 +02:00
|
|
|
import 'package:git_touch/screens/gh_gists_files.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/gh_issue.dart';
|
|
|
|
import 'package:git_touch/screens/gh_issue_form.dart';
|
|
|
|
import 'package:git_touch/screens/gh_issues.dart';
|
2022-09-19 19:26:38 +02:00
|
|
|
import 'package:git_touch/screens/gh_meta.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/gh_object.dart';
|
|
|
|
import 'package:git_touch/screens/gh_pulls.dart';
|
2021-01-31 15:08:37 +01:00
|
|
|
import 'package:git_touch/screens/gh_releases.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/gh_repo.dart';
|
|
|
|
import 'package:git_touch/screens/gh_repos.dart';
|
|
|
|
import 'package:git_touch/screens/gh_user.dart';
|
|
|
|
import 'package:git_touch/screens/gh_users.dart';
|
|
|
|
import 'package:git_touch/screens/gl_blob.dart';
|
2020-02-29 10:06:47 +01:00
|
|
|
import 'package:git_touch/screens/gl_commit.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/gl_commits.dart';
|
|
|
|
import 'package:git_touch/screens/gl_group.dart';
|
|
|
|
import 'package:git_touch/screens/gl_issue.dart';
|
2021-01-18 17:46:31 +01:00
|
|
|
import 'package:git_touch/screens/gl_issue_form.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/gl_issues.dart';
|
|
|
|
import 'package:git_touch/screens/gl_members.dart';
|
|
|
|
import 'package:git_touch/screens/gl_merge_requests.dart';
|
|
|
|
import 'package:git_touch/screens/gl_project.dart';
|
2020-04-06 08:48:50 +02:00
|
|
|
import 'package:git_touch/screens/gl_starrers.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:git_touch/screens/gl_tree.dart';
|
|
|
|
import 'package:git_touch/screens/gl_user.dart';
|
2021-01-23 15:08:05 +01:00
|
|
|
import 'package:git_touch/screens/go_commits.dart';
|
|
|
|
import 'package:git_touch/screens/go_issues.dart';
|
|
|
|
import 'package:git_touch/screens/go_object.dart';
|
|
|
|
import 'package:git_touch/screens/go_orgs.dart';
|
|
|
|
import 'package:git_touch/screens/go_repo.dart';
|
|
|
|
import 'package:git_touch/screens/go_repos.dart';
|
|
|
|
import 'package:git_touch/screens/go_user.dart';
|
|
|
|
import 'package:git_touch/screens/go_users.dart';
|
2020-02-07 15:20:06 +01:00
|
|
|
import 'package:git_touch/screens/gt_commits.dart';
|
2021-01-10 07:20:03 +01:00
|
|
|
import 'package:git_touch/screens/gt_issue.dart';
|
|
|
|
import 'package:git_touch/screens/gt_issue_comment.dart';
|
|
|
|
import 'package:git_touch/screens/gt_issue_form.dart';
|
2020-02-07 15:20:06 +01:00
|
|
|
import 'package:git_touch/screens/gt_issues.dart';
|
|
|
|
import 'package:git_touch/screens/gt_object.dart';
|
2020-10-06 07:25:43 +02:00
|
|
|
import 'package:git_touch/screens/gt_orgs.dart';
|
2020-02-07 15:20:06 +01:00
|
|
|
import 'package:git_touch/screens/gt_repo.dart';
|
2020-10-05 11:23:43 +02:00
|
|
|
import 'package:git_touch/screens/gt_repos.dart';
|
2020-10-06 07:53:07 +02:00
|
|
|
import 'package:git_touch/screens/gt_status.dart';
|
2020-02-07 15:20:06 +01:00
|
|
|
import 'package:git_touch/screens/gt_user.dart';
|
2020-10-05 12:01:49 +02:00
|
|
|
import 'package:git_touch/screens/gt_users.dart';
|
2020-02-01 06:26:14 +01:00
|
|
|
import 'package:git_touch/screens/login.dart';
|
|
|
|
import 'package:git_touch/screens/settings.dart';
|
2022-09-11 19:54:07 +02:00
|
|
|
import 'package:go_router/go_router.dart';
|
2020-02-01 06:26:14 +01:00
|
|
|
|
2022-09-11 19:54:07 +02:00
|
|
|
final router = GoRouter(
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: '/',
|
|
|
|
builder: (context, state) => Home(),
|
|
|
|
routes: [
|
|
|
|
// common
|
|
|
|
GoRoute(
|
|
|
|
path: 'choose-code-theme',
|
2022-09-12 05:54:41 +02:00
|
|
|
builder: (context, state) => CodeThemeScreen(),
|
2022-09-11 19:54:07 +02:00
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'login',
|
2022-09-12 05:54:41 +02:00
|
|
|
builder: (context, state) => LoginScreen(),
|
2022-09-11 19:54:07 +02:00
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'settings',
|
|
|
|
builder: (context, state) => SettingsScreen(),
|
2022-09-19 19:26:38 +02:00
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'github-meta',
|
|
|
|
builder: (context, state) => const GhMetaScreen(),
|
|
|
|
),
|
|
|
|
],
|
2022-09-11 19:54:07 +02:00
|
|
|
),
|
2020-02-01 06:26:14 +01:00
|
|
|
|
2022-09-11 19:54:07 +02:00
|
|
|
// github
|
|
|
|
GoRoute(
|
|
|
|
path: 'github',
|
|
|
|
builder: (context, state) => Home(),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: ':login',
|
|
|
|
builder: (context, state) {
|
|
|
|
final login = state.params['login']!;
|
|
|
|
final tab = state.queryParams['tab'];
|
|
|
|
switch (tab) {
|
|
|
|
case 'followers':
|
|
|
|
return GhFollowers(login);
|
|
|
|
case 'following':
|
|
|
|
return GhFollowing(login);
|
|
|
|
case 'people':
|
|
|
|
return GhMembers(login);
|
|
|
|
case 'stars':
|
|
|
|
return GhStars(login);
|
|
|
|
case 'repositories':
|
2022-09-18 09:44:25 +02:00
|
|
|
return GhRepos(login);
|
2022-09-11 19:54:07 +02:00
|
|
|
case 'organizations':
|
2022-09-18 10:51:59 +02:00
|
|
|
return GhOrgs(login);
|
2022-09-11 19:54:07 +02:00
|
|
|
case 'gists':
|
|
|
|
return GhGistsScreen(login);
|
|
|
|
case 'events':
|
|
|
|
return GhEventsScreen(login);
|
|
|
|
default:
|
2022-09-24 07:22:07 +02:00
|
|
|
return GhUserScreen(login);
|
2022-09-11 19:54:07 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'gists/:id',
|
|
|
|
builder: (context, state) => GhGistsFilesScreen(
|
|
|
|
state.params['login']!,
|
|
|
|
state.params['id']!,
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: ':file',
|
|
|
|
builder: (context, state) => GistObjectScreen(
|
|
|
|
state.params['login']!,
|
|
|
|
state.params['id']!,
|
|
|
|
state.params['file']!,
|
|
|
|
content: state.queryParams['content'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: ':owner/:name',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GhRepoScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
branch: state.queryParams['ref'],
|
|
|
|
);
|
|
|
|
},
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'stargazers',
|
|
|
|
builder: (context, state) => GhStargazers(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'watchers',
|
|
|
|
builder: (context, state) =>
|
|
|
|
GhWachers(state.params['owner']!, state.params['name']!),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'contributors',
|
|
|
|
builder: (context, state) => GhContributorsScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'releases',
|
|
|
|
builder: (context, state) => GhReleasesScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'commits/:branch',
|
|
|
|
builder: (context, state) => GhCommits(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
branch: state.params['branch'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'compare/:before/:head',
|
|
|
|
builder: (context, state) => GhComparisonScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['before']!,
|
|
|
|
state.params['head']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'blob/:ref',
|
|
|
|
builder: (context, state) => GhObjectScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['ref']!,
|
|
|
|
path: state.queryParams['path'],
|
|
|
|
raw: state.queryParams['raw'],
|
|
|
|
)),
|
|
|
|
GoRoute(
|
|
|
|
path: 'issues',
|
|
|
|
builder: (context, state) => GhIssuesScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
2022-10-04 19:40:03 +02:00
|
|
|
path: 'new',
|
|
|
|
builder: (context, state) => GhIssueFormScreen(
|
2022-09-11 19:54:07 +02:00
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
2022-10-04 19:40:03 +02:00
|
|
|
path: ':number',
|
|
|
|
builder: (context, state) => GhIssueScreen(
|
2022-09-11 19:54:07 +02:00
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
2022-10-04 19:40:03 +02:00
|
|
|
int.parse(state.params['number']!),
|
2022-09-11 19:54:07 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
GoRoute(
|
2022-09-30 20:27:21 +02:00
|
|
|
path: 'pulls',
|
2022-09-11 19:54:07 +02:00
|
|
|
builder: (context, state) => GhPullsScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
2022-09-30 20:27:21 +02:00
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'pull',
|
2022-09-30 22:09:55 +02:00
|
|
|
redirect: (_, state) =>
|
2022-09-30 20:27:21 +02:00
|
|
|
'/github/${state.params['owner']!}/${state.params['name']!}/pulls',
|
2022-09-11 19:54:07 +02:00
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: ':number',
|
|
|
|
builder: (context, state) => GhIssueScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
int.parse(state.params['number']!),
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'files',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GhFilesScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
int.parse(state.params['number']!),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2020-02-01 06:26:14 +01:00
|
|
|
|
2022-09-11 19:54:07 +02:00
|
|
|
// gitlab
|
|
|
|
GoRoute(
|
|
|
|
path: 'gitlab',
|
|
|
|
builder: (context, state) => Home(),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'user/:id',
|
|
|
|
builder: (context, state) =>
|
|
|
|
GlUserScreen(int.parse(state.params['id']!)),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'group/:id',
|
|
|
|
builder: (context, state) =>
|
|
|
|
GlGroupScreen(int.parse(state.params['id']!)),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'groups/:id/members',
|
|
|
|
builder: (context, state) =>
|
|
|
|
GlMembersScreen(int.parse(state.params['id']!), 'groups'),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'projects/:id',
|
|
|
|
builder: (context, state) => GlProjectScreen(
|
|
|
|
int.parse(state.params['id']!),
|
|
|
|
branch: state.queryParams['branch'],
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'starrers',
|
|
|
|
builder: (context, state) =>
|
|
|
|
GlStarrersScreen(int.parse(state.params['id']!)),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'commits',
|
|
|
|
builder: (context, state) => GlCommitsScreen(
|
|
|
|
state.params['id']!,
|
|
|
|
prefix: state.queryParams['prefix'],
|
|
|
|
branch: state.queryParams['branch'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'commit/:sha',
|
|
|
|
builder: (context, state) => GlCommitScreen(
|
|
|
|
state.params['id']!,
|
|
|
|
sha: state.params['sha']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'members',
|
|
|
|
builder: (context, state) => GlMembersScreen(
|
|
|
|
int.parse(state.params['id']!), 'projects'),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'blob/:ref',
|
|
|
|
builder: (context, state) => GlBlobScreen(
|
|
|
|
int.parse(state.params['id']!),
|
|
|
|
state.params['ref']!,
|
|
|
|
path: state.queryParams['path'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'tree/:ref',
|
|
|
|
builder: (context, state) => GlTreeScreen(
|
|
|
|
int.parse(state.params['id']!),
|
|
|
|
state.params['ref']!,
|
|
|
|
path: state.queryParams['path'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'issues',
|
|
|
|
builder: (context, state) => GlIssuesScreen(
|
|
|
|
state.params['id']!,
|
|
|
|
prefix: state.queryParams['prefix'],
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
2022-10-04 19:40:03 +02:00
|
|
|
path: 'new',
|
|
|
|
builder: (context, state) => GlIssueFormScreen(
|
2022-09-11 19:54:07 +02:00
|
|
|
int.parse(state.params['id']!),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
2022-10-04 19:40:03 +02:00
|
|
|
path: ':iid',
|
|
|
|
builder: (context, state) => GlIssueScreen(
|
2022-09-11 19:54:07 +02:00
|
|
|
int.parse(state.params['id']!),
|
2022-10-04 19:40:03 +02:00
|
|
|
int.parse(state.params['iid']!),
|
2022-09-11 19:54:07 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
GoRoute(
|
|
|
|
path: 'merge_requests',
|
|
|
|
builder: (context, state) => GlMergeRequestsScreen(
|
|
|
|
state.params['id']!,
|
|
|
|
prefix: state.queryParams['prefix'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
2020-02-01 06:26:14 +01:00
|
|
|
|
2022-09-11 19:54:07 +02:00
|
|
|
// gitea
|
|
|
|
GoRoute(
|
|
|
|
path: 'gitea',
|
|
|
|
builder: (context, state) => Home(),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'status',
|
|
|
|
builder: (context, state) => GtStatusScreen(),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: ':login',
|
|
|
|
builder: (context, state) {
|
|
|
|
final login = state.params['login']!;
|
|
|
|
final tab = state.queryParams['tab'];
|
|
|
|
switch (tab) {
|
|
|
|
case 'followers':
|
|
|
|
return GtUsersScreen.followers(login);
|
|
|
|
case 'following':
|
|
|
|
return GtUsersScreen.following(login);
|
|
|
|
case 'people':
|
|
|
|
return GtUsersScreen.member(login);
|
|
|
|
case 'stars':
|
|
|
|
return GtReposScreen.star(login);
|
|
|
|
case 'repositories':
|
|
|
|
return GtReposScreen(login);
|
|
|
|
case 'orgrepo':
|
|
|
|
return GtReposScreen.org(login);
|
|
|
|
case 'organizations':
|
|
|
|
return GtOrgsScreen.ofUser(login);
|
|
|
|
default:
|
|
|
|
return GtUserScreen(login);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: ':owner/:name',
|
|
|
|
builder: (context, state) => GtRepoScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'blob',
|
|
|
|
builder: (context, state) => GtObjectScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
path: state.queryParams['path'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'stargazers',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GtUsersScreen.stargazers(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'watchers',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GtUsersScreen.watchers(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'stargazers',
|
|
|
|
builder: (context, state) => GtUsersScreen.stargazers(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'watchers',
|
|
|
|
builder: (context, state) => GtUsersScreen.watchers(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'forks',
|
|
|
|
builder: (context, state) => GtReposScreen.forks(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'commits',
|
|
|
|
builder: (context, state) => GtCommitsScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'pulls',
|
|
|
|
builder: (context, state) => GtIssuesScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
isPr: true,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'issues',
|
|
|
|
builder: (context, state) => GtIssuesScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: ':number',
|
|
|
|
builder: (context, state) => GtIssueScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['number']!,
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'comment',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GtIssueCommentScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['number']!,
|
|
|
|
body: state.queryParams['body']!,
|
|
|
|
id: state.queryParams['id']!,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
GoRoute(
|
|
|
|
path: 'new',
|
|
|
|
builder: (context, state) => GtIssueFormScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
2020-02-01 06:26:14 +01:00
|
|
|
|
2022-09-11 19:54:07 +02:00
|
|
|
// bitbucket
|
|
|
|
GoRoute(
|
|
|
|
path: 'bitbucket',
|
|
|
|
builder: (context, state) => Home(),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: ':login',
|
|
|
|
builder: (context, state) => BbUserScreen(
|
|
|
|
state.params['login']!,
|
|
|
|
isTeam: state.queryParams['team']! == '1',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: ':owner/:name',
|
|
|
|
builder: (context, state) => BbRepoScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
branch: state.params['branch'],
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'src/:ref',
|
|
|
|
builder: (context, state) => BbObjectScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['ref']!,
|
|
|
|
path: state.queryParams['path'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'commits/:ref',
|
|
|
|
builder: (context, state) => BbCommitsScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['ref']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'issues',
|
|
|
|
builder: (context, state) => BbIssuesScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'new',
|
|
|
|
builder: (context, state) => BbIssueFormScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: ':number',
|
|
|
|
builder: (context, state) {
|
|
|
|
return BbIssueScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['number']!,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'comment',
|
|
|
|
builder: (context, state) {
|
|
|
|
return BbIssueCommentScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['number']!,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'pulls',
|
|
|
|
builder: (context, state) => BbPullsScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2020-10-17 11:35:08 +02:00
|
|
|
|
2022-09-11 19:54:07 +02:00
|
|
|
// gitee
|
|
|
|
GoRoute(
|
|
|
|
path: 'gitee',
|
|
|
|
builder: (context, state) => Home(),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: ':login',
|
|
|
|
builder: (context, state) {
|
|
|
|
final login = state.params['login']!;
|
|
|
|
final tab = state.queryParams['tab'];
|
|
|
|
switch (tab) {
|
|
|
|
case 'followers':
|
|
|
|
return GeUsersScreen.followers(login);
|
|
|
|
case 'following':
|
|
|
|
return GeUsersScreen.following(login);
|
|
|
|
// case 'people':
|
|
|
|
case 'stars':
|
|
|
|
return GeReposScreen.star(login);
|
|
|
|
case 'repositories':
|
|
|
|
return GeReposScreen(login);
|
|
|
|
default:
|
|
|
|
return GeUserScreen(login);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'search',
|
|
|
|
builder: (context, state) => GeSearchScreen(),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: ':owner/:name',
|
|
|
|
builder: (context, state) => GeRepoScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
branch: state.queryParams['branch'],
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'stargazers',
|
|
|
|
builder: (context, state) => GeUsersScreen.stargazers(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'watchers',
|
|
|
|
builder: (context, state) => GeUsersScreen.watchers(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'forks',
|
|
|
|
builder: (context, state) => GeReposScreen.forks(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'blob/:sha',
|
|
|
|
builder: (context, state) => GeBlobScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['sha']!,
|
|
|
|
state.params['path']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'tree/:sha',
|
|
|
|
builder: (context, state) => GeTreeScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['sha']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'contributors',
|
|
|
|
builder: (context, state) => GeContributorsScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'commits',
|
|
|
|
builder: (context, state) => GeCommitsScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
branch: state.queryParams['branch'],
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: ':sha',
|
|
|
|
builder: (context, state) => GeCommitScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['sha']!,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'issues',
|
|
|
|
builder: (context, state) => GeIssuesScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'new',
|
|
|
|
builder: (context, state) => GeIssueFormScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: ':number',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GeIssueScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['number']!,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'comment',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GeIssueCommentScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['number']!,
|
|
|
|
isPr: false,
|
|
|
|
body: state.queryParams['body']!,
|
|
|
|
id: state.queryParams['id']!,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'pulls',
|
|
|
|
builder: (context, state) => GePullsScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
isPr: true,
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: ':number',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GeIssueScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['number']!,
|
|
|
|
isPr: true,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'comment',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GeIssueCommentScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['number']!,
|
|
|
|
isPr: true,
|
|
|
|
body: state.queryParams['body']!,
|
|
|
|
id: state.queryParams['id']!,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'files',
|
|
|
|
builder: (context, state) {
|
|
|
|
return GeFilesScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
state.params['number']!,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2021-01-23 15:08:05 +01:00
|
|
|
|
2022-09-11 19:54:07 +02:00
|
|
|
// gogs
|
|
|
|
GoRoute(
|
|
|
|
path: 'gogs',
|
|
|
|
builder: (context, state) => Home(),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: ':login',
|
|
|
|
builder: (context, state) {
|
|
|
|
final login = state.params['login']!;
|
|
|
|
final tab = state.queryParams['tab'];
|
|
|
|
final isViewer = state.queryParams['isViewer'];
|
|
|
|
switch (tab) {
|
|
|
|
case 'followers':
|
|
|
|
return GoUsersScreen.followers(login);
|
|
|
|
case 'following':
|
|
|
|
return GoUsersScreen.following(login);
|
|
|
|
case 'repositories':
|
|
|
|
return GoReposScreen(login,
|
|
|
|
isViewer: isViewer == 'false' ? false : true);
|
|
|
|
case 'organizations':
|
|
|
|
return GoOrgsScreen.ofUser(login,
|
|
|
|
isViewer: isViewer == 'false'
|
|
|
|
? false
|
|
|
|
: true); // handle better?
|
|
|
|
default:
|
|
|
|
return GoUserScreen(login);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: ':owner/:name',
|
|
|
|
builder: (context, state) => GoRepoScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
branch: state.queryParams['branch'],
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: 'blob',
|
|
|
|
builder: (context, state) => GoObjectScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
path: state.params['path'],
|
|
|
|
ref: state.params['ref'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'commits',
|
|
|
|
builder: (context, state) => GoCommitsScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
branch: state.queryParams['ref'],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: 'issues',
|
|
|
|
builder: (context, state) => GoIssuesScreen(
|
|
|
|
state.params['owner']!,
|
|
|
|
state.params['name']!,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
2021-01-23 15:08:05 +01:00
|
|
|
),
|
2022-09-11 19:54:07 +02:00
|
|
|
],
|
|
|
|
);
|