Skip to content

Commit

Permalink
GoRouter doesn't like subroutes for external links (#5706)
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k authored Oct 18, 2024
1 parent b14389c commit 4025f30
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/smooth_app/lib/pages/navigator/app_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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';
}

0 comments on commit 4025f30

Please sign in to comment.