fix: pull page redirect

This commit is contained in:
Rongjian Zhang 2022-10-06 15:16:44 +08:00
parent 61d5a3e846
commit 7b51747576
1 changed files with 15 additions and 22 deletions

View File

@ -253,32 +253,25 @@ final router = GoRouter(
), ),
), ),
GoRoute( GoRoute(
path: 'pull', path: 'pull/:number',
redirect: (_, state) => builder: (context, state) => GhIssueScreen(
'/github/${state.params['owner']!}/${state.params['name']!}/pulls', state.params['owner']!,
state.params['name']!,
int.parse(state.params['number']!),
),
routes: [ routes: [
GoRoute( GoRoute(
path: ':number', path: 'files',
builder: (context, state) => GhIssueScreen( builder: (context, state) {
state.params['owner']!, return GhFilesScreen(
state.params['name']!, state.params['owner']!,
int.parse(state.params['number']!), 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']!),
);
},
),
],
), ),
], ],
) ),
], ],
), ),
], ],