From 6fd68a6114c276b2ff783d84c10320f7f0b79d32 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Fri, 14 Jul 2023 11:40:35 +0200 Subject: [PATCH] fix(neon): Qrcode login routing --- packages/neon/neon/lib/src/router.dart | 6 ++++-- packages/neon/neon/lib/src/router.g.dart | 4 ++++ packages/neon/neon/pubspec.yaml | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/neon/neon/lib/src/router.dart b/packages/neon/neon/lib/src/router.dart index ceb05c0c..9516e05c 100644 --- a/packages/neon/neon/lib/src/router.dart +++ b/packages/neon/neon/lib/src/router.dart @@ -208,8 +208,9 @@ class LoginQrcodeRoute extends GoRouteData { class LoginCheckServerStatusRoute extends GoRouteData { const LoginCheckServerStatusRoute({ required this.serverUrl, - }) : loginName = null, - password = null; + this.loginName, + this.password, + }); const LoginCheckServerStatusRoute.withCredentials({ required this.serverUrl, @@ -303,6 +304,7 @@ class _AddAccountFlowRoute extends LoginFlowRoute { const _AddAccountFlowRoute({ required super.serverUrl, }); + @override String get serverUrl => super.serverUrl; } diff --git a/packages/neon/neon/lib/src/router.g.dart b/packages/neon/neon/lib/src/router.g.dart index 33f3e75d..35985eb7 100644 --- a/packages/neon/neon/lib/src/router.g.dart +++ b/packages/neon/neon/lib/src/router.g.dart @@ -326,12 +326,16 @@ extension $LoginQrcodeRouteExtension on LoginQrcodeRoute { extension $LoginCheckServerStatusRouteExtension on LoginCheckServerStatusRoute { static LoginCheckServerStatusRoute _fromState(GoRouterState state) => LoginCheckServerStatusRoute( serverUrl: state.queryParameters['server-url']!, + loginName: state.queryParameters['login-name'], + password: state.queryParameters['password'], ); String get location => GoRouteData.$location( '/login/check/server', queryParams: { 'server-url': serverUrl, + if (loginName != null) 'login-name': loginName, + if (password != null) 'password': password, }, ); diff --git a/packages/neon/neon/pubspec.yaml b/packages/neon/neon/pubspec.yaml index 0479da47..b54e10af 100644 --- a/packages/neon/neon/pubspec.yaml +++ b/packages/neon/neon/pubspec.yaml @@ -22,7 +22,7 @@ dependencies: flutter_native_splash: ^2.2.19 flutter_svg: ^2.0.5 flutter_zxing: ^1.1.2 # ^1.2.0 downgrades to image ^3.0.0 which breaks our dependencies. See https://github.com/khoren93/flutter_zxing/issues/94 - go_router: ^8.0.3 + go_router: 8.0.3 http: ^0.13.6 intersperse: ^2.0.0 intl: ^0.18.0 @@ -58,7 +58,7 @@ dependencies: dev_dependencies: build_runner: ^2.4.4 - go_router_builder: ^2.0.1 + go_router_builder: 2.1.1 json_serializable: ^6.6.2 nit_picking: git: