mirror of
https://github.com/git-touch/git-touch
synced 2025-02-20 13:30:38 +01:00
fix(gitlab): tree and blob router
This commit is contained in:
parent
9aec397a60
commit
00d67784af
@ -9,7 +9,7 @@ import 'package:git_touch/widgets/blob_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
final gitlabBlobRouter = RouterScreen(
|
||||
'/gitlab/projects/:id/tree',
|
||||
'/gitlab/projects/:id/blob',
|
||||
(context, params) => GitlabBlobScreen(params['id'].first.toInt,
|
||||
path: params['path']?.first?.urldecode));
|
||||
|
||||
@ -22,7 +22,7 @@ class GitlabBlobScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RefreshStatefulScaffold<GitlabBlob>(
|
||||
title: AppBarTitle(path),
|
||||
title: AppBarTitle(path ?? ''),
|
||||
fetchData: () async {
|
||||
final encodedPath = Uri.encodeComponent(path);
|
||||
final res = await Provider.of<AuthModel>(context).fetchGitlab(
|
||||
|
@ -68,6 +68,7 @@ class GitlabProjectScreen extends StatelessWidget {
|
||||
final langs = t.item2;
|
||||
final badges = t.item3;
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
// final auth = Provider.of<AuthModel>(context);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
@ -105,7 +106,7 @@ class GitlabProjectScreen extends StatelessWidget {
|
||||
if (badges.isNotEmpty)
|
||||
Wrap(spacing: 4, runSpacing: 4, children: [
|
||||
for (var label in badges)
|
||||
SvgPicture.network(label.renderedImageUrl, height: 20)
|
||||
SvgPicture.network(label.renderedImageUrl, height: 20),
|
||||
])
|
||||
]),
|
||||
),
|
||||
|
@ -63,9 +63,9 @@ class GitlabTreeScreen extends StatelessWidget {
|
||||
url: (() {
|
||||
switch (item.type) {
|
||||
case 'tree':
|
||||
return '/projects/$id/tree?path=${item.path.urlencode}';
|
||||
return '/gitlab/projects/$id/tree?path=${item.path.urlencode}';
|
||||
case 'blob':
|
||||
return '/projects/$id/blob?path=${item.path.urlencode}';
|
||||
return '/gitlab/projects/$id/blob?path=${item.path.urlencode}';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user