Skip to content

Commit

Permalink
[RCF-741] (#431)
Browse files Browse the repository at this point in the history
* added collab env to gradle

Signed-off-by: G S Prakash <[email protected]>

* changed server url

Signed-off-by: G S Prakash <[email protected]>

* Added the validation for applicant biometric threshold

Signed-off-by: G S Prakash <[email protected]>

---------

Signed-off-by: G S Prakash <[email protected]>
  • Loading branch information
GSPrakash2662 authored Aug 19, 2024
1 parent 2d49503 commit 75f6d1e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/provider/global_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,20 @@ 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) {
_isPageChanged = value;
notifyListeners();
}

set isValidBiometricCapture(bool value) {
_isValidBiometricCapture = value;
notifyListeners();
}

set preRegControllerRefresh(bool value) {
_preRegControllerRefresh = value;
notifyListeners();
Expand Down
8 changes: 8 additions & 0 deletions lib/ui/process_ui/new_process.dart
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@ class _NewProcessState extends State<NewProcess> with WidgetsBindingObserver {

break;
}
if(globalProvider.isValidBiometricCapture){
isValid = false;
break;
}
}
}
}
Expand Down Expand Up @@ -464,6 +468,10 @@ class _NewProcessState extends State<NewProcess> with WidgetsBindingObserver {

break;
}
if(globalProvider.isValidBiometricCapture){
isValid = false;
break;
}
}
}
if (response.compareTo(screen.fields!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class BiometricCaptureScanBlockPortrait extends StatefulWidget {
class _BiometricCaptureScanBlockPortraitState
extends State<BiometricCaptureScanBlockPortrait> {
bool isPortrait = true;
late GlobalProvider globalProvider;

@override
void initState() {
// SystemChrome.setPreferredOrientations([
Expand All @@ -47,6 +49,7 @@ class _BiometricCaptureScanBlockPortraitState
context
.read<BiometricCaptureControlProvider>()
.biometricCaptureScanBlockTabIndex = 1;
globalProvider = Provider.of<GlobalProvider>(context, listen: false);

super.initState();
}
Expand Down Expand Up @@ -191,9 +194,34 @@ class _BiometricCaptureScanBlockPortraitState
_showScanDialogBox(List<Uint8List?> temp) async {
int currentAttemptNo = await BiometricsApi().getBioAttempt(
widget.field.id!, biometricAttributeData.title.replaceAll(" ", ""));
globalProvider.isValidBiometricCapture = validateCaptureException();
_showCustomAlert(currentAttemptNo, temp);
}

bool validateCaptureException(){
return (
(context.read<BiometricCaptureControlProvider>().iris.isScanned) &&
(context.read<BiometricCaptureControlProvider>().iris.qualityPercentage <=
int.parse(context.read<BiometricCaptureControlProvider>().iris.thresholdPercentage)) ||

(context.read<BiometricCaptureControlProvider>().rightHand.isScanned) &&
(context.read<BiometricCaptureControlProvider>().rightHand.qualityPercentage <=
int.parse(context.read<BiometricCaptureControlProvider>().rightHand.thresholdPercentage)) ||

(context.read<BiometricCaptureControlProvider>().leftHand.isScanned) &&
(context.read<BiometricCaptureControlProvider>().leftHand.qualityPercentage <=
int.parse(context.read<BiometricCaptureControlProvider>().leftHand.thresholdPercentage)) ||

(context.read<BiometricCaptureControlProvider>().thumbs.isScanned) &&
(context.read<BiometricCaptureControlProvider>().thumbs.qualityPercentage <=
int.parse(context.read<BiometricCaptureControlProvider>().thumbs.thresholdPercentage)) ||

(context.read<BiometricCaptureControlProvider>().face.isScanned) &&
(context.read<BiometricCaptureControlProvider>().face.qualityPercentage <=
int.parse(context.read<BiometricCaptureControlProvider>().face.thresholdPercentage))
);
}

noOfTrue(List<bool> list) {
int i = 0;
for (var e in list) {
Expand Down

0 comments on commit 75f6d1e

Please sign in to comment.