mirror of
https://github.com/git-touch/git-touch
synced 2025-02-21 05:51:06 +01:00
improvement: router prefix
This commit is contained in:
parent
7496129973
commit
8089980e20
@ -174,6 +174,14 @@ class ThemeModel with ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
pushGitlab(BuildContext context, String url, {bool replace = false}) {
|
||||
if (url.startsWith('/')) {
|
||||
push(context, '/gitlab/$url', replace: replace);
|
||||
} else {
|
||||
launchUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> showConfirm(BuildContext context, Widget content) {
|
||||
switch (theme) {
|
||||
case AppThemeType.cupertino:
|
||||
|
@ -9,7 +9,7 @@ import 'package:git_touch/widgets/blob_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
final gitlabBlobRouter = RouterScreen(
|
||||
'/projects/:id/tree',
|
||||
'/gitlab/projects/:id/tree',
|
||||
(context, params) => GitlabBlobScreen(params['id'].first.toInt,
|
||||
path: params['path']?.first?.urldecode));
|
||||
|
||||
|
@ -10,7 +10,7 @@ import 'package:timeago/timeago.dart' as timeago;
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
final gitlabIssueRouter = RouterScreen(
|
||||
'/projects/:id/issues/:iid',
|
||||
'/gitlab/projects/:id/issues/:iid',
|
||||
(context, params) => GitlabIssueScreen(
|
||||
int.parse(['id'].first), int.parse(params['iid'].first)));
|
||||
|
||||
|
@ -13,7 +13,7 @@ import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/widgets/repository_item.dart';
|
||||
import 'package:git_touch/widgets/action_button.dart';
|
||||
|
||||
final gitlabProjectRouter = RouterScreen('/projects/:id',
|
||||
final gitlabProjectRouter = RouterScreen('/gitlab/projects/:id',
|
||||
(context, params) => GitlabProjectScreen(int.parse(['id'].first)));
|
||||
|
||||
class GitlabProjectScreen extends StatelessWidget {
|
||||
|
@ -11,7 +11,7 @@ import 'package:primer/primer.dart';
|
||||
import 'package:seti/seti.dart';
|
||||
|
||||
final gitlabTreeRouter = RouterScreen(
|
||||
'/projects/:id/tree',
|
||||
'/gitlab/projects/:id/tree',
|
||||
(context, params) => GitlabTreeScreen(params['id'].first.toInt,
|
||||
path: params['path']?.first?.urldecode));
|
||||
|
||||
|
@ -10,7 +10,7 @@ import 'package:tuple/tuple.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
|
||||
final gitlabUserRouter = RouterScreen(
|
||||
'/user/:id',
|
||||
'/gitlab/user/:id',
|
||||
(context, parameters) =>
|
||||
GitlabUserScreen(int.parse(parameters['id'].first)));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user