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!);