From 75f6d1e057cf04143efdf02e71a2dd869bf8574c Mon Sep 17 00:00:00 2001 From: G S Prakash Naidu <146939767+GSPrakashNaidu2662@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:03:59 +0530 Subject: [PATCH] [RCF-741] (#431) * added collab env to gradle Signed-off-by: G S Prakash * changed server url Signed-off-by: G S Prakash * Added the validation for applicant biometric threshold Signed-off-by: G S Prakash --------- Signed-off-by: G S Prakash --- lib/provider/global_provider.dart | 7 +++++ lib/ui/process_ui/new_process.dart | 8 ++++++ ...biometric_capture_scan_block_portrait.dart | 28 +++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/lib/provider/global_provider.dart b/lib/provider/global_provider.dart index 1e5afc6e..58a98212 100644 --- a/lib/provider/global_provider.dart +++ b/lib/provider/global_provider.dart @@ -49,6 +49,8 @@ class GlobalProvider with ChangeNotifier { String get onboardingProcessName => _onboardingProcessName; bool get isPageChanged => _isPageChanged; bool _preRegControllerRefresh = false; + bool _isValidBiometricCapture = false; + bool get isValidBiometricCapture => _isValidBiometricCapture; bool get preRegControllerRefresh => _preRegControllerRefresh; set isPageChanged(bool value) { @@ -56,6 +58,11 @@ class GlobalProvider with ChangeNotifier { notifyListeners(); } + set isValidBiometricCapture(bool value) { + _isValidBiometricCapture = value; + notifyListeners(); + } + set preRegControllerRefresh(bool value) { _preRegControllerRefresh = value; notifyListeners(); diff --git a/lib/ui/process_ui/new_process.dart b/lib/ui/process_ui/new_process.dart index 149636aa..e05d42b2 100644 --- a/lib/ui/process_ui/new_process.dart +++ b/lib/ui/process_ui/new_process.dart @@ -408,6 +408,10 @@ class _NewProcessState extends State with WidgetsBindingObserver { break; } + if(globalProvider.isValidBiometricCapture){ + isValid = false; + break; + } } } } @@ -464,6 +468,10 @@ class _NewProcessState extends State with WidgetsBindingObserver { break; } + if(globalProvider.isValidBiometricCapture){ + isValid = false; + break; + } } } if (response.compareTo(screen.fields! diff --git a/lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart b/lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart index 0ae0544c..880ee4af 100644 --- a/lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart +++ b/lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart @@ -37,6 +37,8 @@ class BiometricCaptureScanBlockPortrait extends StatefulWidget { class _BiometricCaptureScanBlockPortraitState extends State { bool isPortrait = true; + late GlobalProvider globalProvider; + @override void initState() { // SystemChrome.setPreferredOrientations([ @@ -47,6 +49,7 @@ class _BiometricCaptureScanBlockPortraitState context .read() .biometricCaptureScanBlockTabIndex = 1; + globalProvider = Provider.of(context, listen: false); super.initState(); } @@ -191,9 +194,34 @@ class _BiometricCaptureScanBlockPortraitState _showScanDialogBox(List temp) async { int currentAttemptNo = await BiometricsApi().getBioAttempt( widget.field.id!, biometricAttributeData.title.replaceAll(" ", "")); + globalProvider.isValidBiometricCapture = validateCaptureException(); _showCustomAlert(currentAttemptNo, temp); } + bool validateCaptureException(){ + return ( + (context.read().iris.isScanned) && + (context.read().iris.qualityPercentage <= + int.parse(context.read().iris.thresholdPercentage)) || + + (context.read().rightHand.isScanned) && + (context.read().rightHand.qualityPercentage <= + int.parse(context.read().rightHand.thresholdPercentage)) || + + (context.read().leftHand.isScanned) && + (context.read().leftHand.qualityPercentage <= + int.parse(context.read().leftHand.thresholdPercentage)) || + + (context.read().thumbs.isScanned) && + (context.read().thumbs.qualityPercentage <= + int.parse(context.read().thumbs.thresholdPercentage)) || + + (context.read().face.isScanned) && + (context.read().face.qualityPercentage <= + int.parse(context.read().face.thresholdPercentage)) + ); + } + noOfTrue(List list) { int i = 0; for (var e in list) {