From 5589d5b563c2e7d31b5fc6b3c74d60ed50645975 Mon Sep 17 00:00:00 2001 From: SikanderSaleem Date: Mon, 28 Jul 2025 13:36:07 +0300 Subject: [PATCH] asset currency model & ios face id failed improvement. --- lib/models/device/asset_by_id_model.dart | 8 +++++--- lib/new_views/pages/splash_page.dart | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/models/device/asset_by_id_model.dart b/lib/models/device/asset_by_id_model.dart index f83eb4bc..691a916a 100644 --- a/lib/models/device/asset_by_id_model.dart +++ b/lib/models/device/asset_by_id_model.dart @@ -24,7 +24,7 @@ class AssetByIdModel { int? testsDay; num? purchasingPrice; String? nbv; - String? currency; + Lookup? currency; String? poDate; String? poNo; String? invoiceNumber; @@ -153,7 +153,7 @@ class AssetByIdModel { testsDay = json['testsDay']; purchasingPrice = json['purchasingPrice']; nbv = json['nbv']; - currency = json['currency']; + currency = json['currency'] != null ? Lookup.fromJson(json['currency']) : null; poDate = json['poDate']; poNo = json['poNo']; invoiceNumber = json['invoiceNumber']; @@ -247,7 +247,9 @@ class AssetByIdModel { data['testsDay'] = testsDay; data['purchasingPrice'] = purchasingPrice; data['nbv'] = nbv; - data['currency'] = currency; + if (currency != null) { + data['currency'] = currency?.toJson(); + } data['poDate'] = poDate; data['poNo'] = poNo; data['invoiceNumber'] = invoiceNumber; diff --git a/lib/new_views/pages/splash_page.dart b/lib/new_views/pages/splash_page.dart index 4178cdbf..3e3cbc97 100644 --- a/lib/new_views/pages/splash_page.dart +++ b/lib/new_views/pages/splash_page.dart @@ -104,7 +104,13 @@ class _SplashPageState extends State { } void handleLocalAuth() async { - bool isSuccess = await checkDualAuthentication(); + bool isSuccess = false; + try { + isSuccess = await checkDualAuthentication(); + } catch (ex) { + // ios exception when scan failed. + } + if (isSuccess) { _userProvider.setUser(_settingProvider.user!);