From 38e2b27ff57efad58df31b4a0e3413f80484927a Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Fri, 23 Feb 2024 14:20:03 +0545 Subject: [PATCH] feat: Update enterpise waller overxx card calls --- .../helper_functions/discover_credential.dart | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/dashboard/home/tab_bar/credentials/helper_functions/discover_credential.dart b/lib/dashboard/home/tab_bar/credentials/helper_functions/discover_credential.dart index bf072eaed..bedb7cb03 100644 --- a/lib/dashboard/home/tab_bar/credentials/helper_functions/discover_credential.dart +++ b/lib/dashboard/home/tab_bar/credentials/helper_functions/discover_credential.dart @@ -43,8 +43,8 @@ Future discoverCredential({ final profileCubit = context.read(); - final vcFormatType = profileCubit.state.model.profileSetting - .selfSovereignIdentityOptions.customOidc4vcProfile.vcFormatType; + final customOidc4vcProfile = profileCubit.state.model.profileSetting + .selfSovereignIdentityOptions.customOidc4vcProfile; final List credentialSubjectTypeListForCheck = [ CredentialSubjectType.defiCompliance, @@ -65,9 +65,8 @@ Future discoverCredential({ /// here check for over18, over15, age range and over13 to take photo for /// AI KYC - if (vcFormatType == VCFormatType.ldpVc && + if (customOidc4vcProfile.vcFormatType == VCFormatType.ldpVc && dummyCredential.credentialSubjectType.checkForAIKYC) { - /// For DefiCompliance, it is not necessary to use Yoti. Instead, /// we can directly proceed with Id360. if (dummyCredential.credentialSubjectType == @@ -81,6 +80,23 @@ Future discoverCredential({ return; } + if (profileCubit.state.model.walletType == WalletType.enterprise) { + final discoverCardsOptions = + profileCubit.state.model.profileSetting.discoverCardsOptions; + + if (discoverCardsOptions != null) { + if (discoverCardsOptions.displayOver13 || + discoverCardsOptions.displayOver15 || + discoverCardsOptions.displayOver18 || + discoverCardsOptions.displayOver21 || + discoverCardsOptions.displayOver50 || + discoverCardsOptions.displayOver65) { + await LaunchUrl.launch(dummyCredential.link!); + return; + } + } + } + await Navigator.push( context, ChooseVerificationMethodPage.route(