Skip to content

Commit

Permalink
feat: Update enterpise waller overxx card calls
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Feb 23, 2024
1 parent b60f218 commit 38e2b27
Showing 1 changed file with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Future<void> discoverCredential({

final profileCubit = context.read<ProfileCubit>();

final vcFormatType = profileCubit.state.model.profileSetting
.selfSovereignIdentityOptions.customOidc4vcProfile.vcFormatType;
final customOidc4vcProfile = profileCubit.state.model.profileSetting
.selfSovereignIdentityOptions.customOidc4vcProfile;

final List<CredentialSubjectType> credentialSubjectTypeListForCheck = [
CredentialSubjectType.defiCompliance,
Expand All @@ -65,9 +65,8 @@ Future<void> 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 ==
Expand All @@ -81,6 +80,23 @@ Future<void> 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<void>(
context,
ChooseVerificationMethodPage.route(
Expand Down

0 comments on commit 38e2b27

Please sign in to comment.