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 6a18924b3..b90f47b60 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 @@ -12,8 +12,8 @@ Future discoverCredential({ }) async { 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, @@ -34,9 +34,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 == @@ -50,6 +49,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(