Browse Source

fix(neon): Qrcode login routing

pull/472/head
Nikolas Rimikis 1 year ago
parent
commit
6fd68a6114
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 6
      packages/neon/neon/lib/src/router.dart
  2. 4
      packages/neon/neon/lib/src/router.g.dart
  3. 4
      packages/neon/neon/pubspec.yaml

6
packages/neon/neon/lib/src/router.dart

@ -208,8 +208,9 @@ class LoginQrcodeRoute extends GoRouteData {
class LoginCheckServerStatusRoute extends GoRouteData { class LoginCheckServerStatusRoute extends GoRouteData {
const LoginCheckServerStatusRoute({ const LoginCheckServerStatusRoute({
required this.serverUrl, required this.serverUrl,
}) : loginName = null, this.loginName,
password = null; this.password,
});
const LoginCheckServerStatusRoute.withCredentials({ const LoginCheckServerStatusRoute.withCredentials({
required this.serverUrl, required this.serverUrl,
@ -303,6 +304,7 @@ class _AddAccountFlowRoute extends LoginFlowRoute {
const _AddAccountFlowRoute({ const _AddAccountFlowRoute({
required super.serverUrl, required super.serverUrl,
}); });
@override @override
String get serverUrl => super.serverUrl; String get serverUrl => super.serverUrl;
} }

4
packages/neon/neon/lib/src/router.g.dart

@ -326,12 +326,16 @@ extension $LoginQrcodeRouteExtension on LoginQrcodeRoute {
extension $LoginCheckServerStatusRouteExtension on LoginCheckServerStatusRoute { extension $LoginCheckServerStatusRouteExtension on LoginCheckServerStatusRoute {
static LoginCheckServerStatusRoute _fromState(GoRouterState state) => LoginCheckServerStatusRoute( static LoginCheckServerStatusRoute _fromState(GoRouterState state) => LoginCheckServerStatusRoute(
serverUrl: state.queryParameters['server-url']!, serverUrl: state.queryParameters['server-url']!,
loginName: state.queryParameters['login-name'],
password: state.queryParameters['password'],
); );
String get location => GoRouteData.$location( String get location => GoRouteData.$location(
'/login/check/server', '/login/check/server',
queryParams: { queryParams: {
'server-url': serverUrl, 'server-url': serverUrl,
if (loginName != null) 'login-name': loginName,
if (password != null) 'password': password,
}, },
); );

4
packages/neon/neon/pubspec.yaml

@ -22,7 +22,7 @@ dependencies:
flutter_native_splash: ^2.2.19 flutter_native_splash: ^2.2.19
flutter_svg: ^2.0.5 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 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 http: ^0.13.6
intersperse: ^2.0.0 intersperse: ^2.0.0
intl: ^0.18.0 intl: ^0.18.0
@ -58,7 +58,7 @@ dependencies:
dev_dependencies: dev_dependencies:
build_runner: ^2.4.4 build_runner: ^2.4.4
go_router_builder: ^2.0.1 go_router_builder: 2.1.1
json_serializable: ^6.6.2 json_serializable: ^6.6.2
nit_picking: nit_picking:
git: git:

Loading…
Cancel
Save