From 7b517475767cbd6ec80e5169632f237693054e2a Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Thu, 6 Oct 2022 15:16:44 +0800 Subject: [PATCH] fix: pull page redirect --- lib/router.dart | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/lib/router.dart b/lib/router.dart index fc4e719..5e18f4c 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -253,32 +253,25 @@ final router = GoRouter( ), ), GoRoute( - path: 'pull', - redirect: (_, state) => - '/github/${state.params['owner']!}/${state.params['name']!}/pulls', + path: 'pull/:number', + builder: (context, state) => GhIssueScreen( + state.params['owner']!, + state.params['name']!, + int.parse(state.params['number']!), + ), 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']!), - ); - }, - ), - ], + path: 'files', + builder: (context, state) { + return GhFilesScreen( + state.params['owner']!, + state.params['name']!, + int.parse(state.params['number']!), + ); + }, ), ], - ) + ), ], ), ],