From dde826e80e99a19563828556c62f19d60b8ff819 Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Fri, 18 Oct 2024 14:53:02 +0200 Subject: [PATCH] GoRouter doesn't like subroutes for external links --- .../lib/pages/navigator/app_navigator.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/smooth_app/lib/pages/navigator/app_navigator.dart b/packages/smooth_app/lib/pages/navigator/app_navigator.dart index e28f03f64e2..34e3b65682d 100644 --- a/packages/smooth_app/lib/pages/navigator/app_navigator.dart +++ b/packages/smooth_app/lib/pages/navigator/app_navigator.dart @@ -228,18 +228,18 @@ class _SmoothGoRouter { } }, ), - GoRoute( - path: _InternalAppRoutes.EXTERNAL_PAGE, - builder: (BuildContext context, GoRouterState state) { - return ExternalPage(path: state.uri.queryParameters['path']!); - }, - ), GoRoute( path: _InternalAppRoutes.SIGNUP_PAGE, builder: (_, __) => const SignUpPage(), ) ], ), + GoRoute( + path: '/${_InternalAppRoutes.EXTERNAL_PAGE}/:page', + builder: (BuildContext context, GoRouterState state) { + return ExternalPage(path: state.pathParameters['page']!); + }, + ), ], redirect: (BuildContext context, GoRouterState state) { final String path = state.matchedLocation; @@ -460,5 +460,5 @@ class AppRoutes { // Open an external link (where path is relative to the OFF website) static String EXTERNAL(String path) => - '/${_InternalAppRoutes.EXTERNAL_PAGE}/?path=$path'; + '/${_InternalAppRoutes.EXTERNAL_PAGE}/$path'; }