CW-898 fix fast scanner (#1957)
* wip * Minor fixes * i hate this * update fast scanner * Update fast_scanner, fix: CW-876 * update fast_scanner (androidx camera / camera2) * bring back sleep
cyan committed
Jan 30, 2025 at 22:42 UTC
448b48063fee437b170f1b2bfe4e70403b8a501e
2 files changed
+4
-4
lib/view_model/node_list/node_create_or_edit_view_model.dart
+3
-3
@@ -1,6 +1,7 @@
1
import 'package:cake_wallet/core/execution_state.dart';
2
import 'package:cake_wallet/entities/qr_scanner.dart';
3
import 'package:cake_wallet/store/settings_store.dart';
4
+import 'package:cw_core/utils/print_verbose.dart';
5
import 'package:flutter/cupertino.dart';
6
import 'package:hive/hive.dart';
7
import 'package:mobx/mobx.dart';
@@ -215,7 +216,6 @@ abstract class NodeCreateOrEditViewModelBase with Store {
216
await PermissionHandler.checkPermission(Permission.camera, context);
217
if (!isCameraPermissionGranted) return;
218
String code = await presentQRScanner(context);
218
-
219
if (code.isEmpty) {
220
throw Exception('Unexpected scan QR code value: value is empty');
221
}
@@ -228,12 +228,12 @@ abstract class NodeCreateOrEditViewModelBase with Store {
228
}
229
230
final userInfo = uri.userInfo;
231
+ final rpcUser = userInfo.length == 2 ? userInfo[0] : '';
232
+ final rpcPassword = userInfo.length == 2 ? userInfo[1] : '';
233
final ipAddress = uri.host;
234
final port = uri.hasPort ? uri.port.toString() : '';
235
final path = uri.path;
236
final queryParams = uri.queryParameters; // Currently not used
235
- final rpcUser = userInfo.split(':').first;
236
- final rpcPassword = userInfo.split(':').length > 1 ? userInfo.split(':')[1] : '';
237
238
await Future.delayed(Duration(milliseconds: 345));
239
pubspec_base.yaml
+1
-1
@@ -17,7 +17,7 @@ dependencies:
17
fast_scanner:
18
git:
19
url: https://github.com/MrCyjaneK/fast_scanner
20
- ref: c5a08720216a508bf1fe3d062ad19d2836545a42
20
+ ref: 69b3276b090fa6ac01b4483ca3adca93a8e615be
21
http: ^1.1.0
22
path_provider: ^2.0.11
23
mobx: ^2.1.4