fix: query params already decoded in fluro

related: #23
This commit is contained in:
Rongjian Zhang 2020-01-31 11:25:23 +08:00
parent 146f731c95
commit a425902756
4 changed files with 8 additions and 9 deletions

View File

@ -15,7 +15,7 @@ final giteaObjectRouter = RouterScreen(
(context, params) => GiteaObjectScreen(
params['owner'].first,
params['name'].first,
path: params['path']?.first?.urldecode,
path: params['path']?.first,
),
);

View File

@ -12,7 +12,7 @@ import 'package:provider/provider.dart';
final gitlabBlobRouter = RouterScreen(
'/gitlab/projects/:id/blob',
(context, params) => GitlabBlobScreen(params['id'].first.toInt,
path: params['path']?.first?.urldecode));
path: params['path']?.first));
class GitlabBlobScreen extends StatelessWidget {
final int id;

View File

@ -11,7 +11,7 @@ import 'package:git_touch/utils/utils.dart';
final gitlabTreeRouter = RouterScreen(
'/gitlab/projects/:id/tree',
(context, params) => GitlabTreeScreen(params['id'].first.toInt,
path: params['path']?.first?.urldecode));
path: params['path']?.first));
class GitlabTreeScreen extends StatelessWidget {
final int id;

View File

@ -12,15 +12,14 @@ import 'package:git_touch/models/auth.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/utils/utils.dart';
final objectRouter = RouterScreen(
'/:owner/:name/blob/:ref',
(context, params) => ObjectScreen(
final objectRouter = RouterScreen('/:owner/:name/blob/:ref', (context, params) {
return ObjectScreen(
params['owner'].first,
params['name'].first,
params['ref'].first,
paths: params['path']?.first?.urldecode?.split('/') ?? [],
),
);
paths: params['path']?.first?.split('/') ?? [],
);
});
class ObjectScreen extends StatelessWidget {
final String owner;