Skip to content

Commit

Permalink
feat: Manage multiple verification card at once #3046
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Nov 1, 2024
1 parent d4069d0 commit 2af67a6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -925,14 +925,19 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {
var type = 'verifiableid';
image = ImageStrings.dummyVerifiableIdCard;

if (vcFormatType == VCFormatType.vcSdJWT) {
final discoverCardsOptions = profileSetting.discoverCardsOptions;
if (discoverCardsOptions != null &&
discoverCardsOptions.displayVerifiableIdSdJwt) {
final discoverCardsOptions = profileSetting.discoverCardsOptions;

if (discoverCardsOptions != null) {
if (discoverCardsOptions.displayVerifiableIdSdJwt &&
assignedVCFormatType == VCFormatType.vcSdJWT) {
type = 'pid';
image = ImageStrings.dummyPIDCard;
} else {
type = 'identitycredential';
} else if (discoverCardsOptions.displayVerifiableIdJwt &&
assignedVCFormatType == VCFormatType.jwtVcJson) {
type = 'verifiableid';
} else if (discoverCardsOptions.displayVerifiableId &&
assignedVCFormatType == VCFormatType.ldpVc) {
type = 'verifiableid';
}
} else if (vcFormatType == VCFormatType.jwtVc) {
type = 'individualverifiableattestation';
Expand Down
16 changes: 9 additions & 7 deletions lib/credentials/cubit/credentials_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,7 @@ class CredentialsCubit extends Cubit<CredentialsState> {
vcFormatType == VCFormatType.auto;
final jwtVcJsonType = vcFormatType == VCFormatType.jwtVcJson ||
vcFormatType == VCFormatType.auto;
final jwtVcType = vcFormatType == VCFormatType.jwtVc ||
vcFormatType == VCFormatType.auto;
final jwtVcType = vcFormatType == VCFormatType.jwtVc;
final vcSdJWType = vcFormatType == VCFormatType.vcSdJWT ||
vcFormatType == VCFormatType.auto;

Expand Down Expand Up @@ -810,7 +809,8 @@ class CredentialsCubit extends Cubit<CredentialsState> {
),
);
}
if (vcSdJWType && discoverCardsOptions.displayVerifiableIdSdJwt) {
if (jwtVcJsonType &&
discoverCardsOptions.displayVerifiableIdSdJwt) {
allCategoryVC.add(
CredInfo(
credentialType: CredentialSubjectType.verifiableIdCard,
Expand Down Expand Up @@ -1087,10 +1087,12 @@ class CredentialsCubit extends Cubit<CredentialsState> {
/// add dummies from the category
dummies[category]?.addAll(
requiredCreds
.map((item) => item.credentialType.dummyCredential(
profileSetting: profileSetting,
assignedVCFormatType: item.formatType,
))
.map(
(item) => item.credentialType.dummyCredential(
profileSetting: profileSetting,
assignedVCFormatType: item.formatType,
),
)
.toList(),
);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/dashboard/profile/models/profile_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ class DiscoverCardsOptions extends Equatable {
required this.displayVerifiableId,
required this.displayExternalIssuer,
this.displayOver18Jwt = false,
this.displayVerifiableIdJwt = true,
this.displayVerifiableIdSdJwt = true,
this.displayVerifiableIdJwt = false,
this.displayVerifiableIdSdJwt = false,
this.displayEmailPass = true,
this.displayEmailPassJwt = true,
this.displayPhonePass = true,
Expand Down

0 comments on commit 2af67a6

Please sign in to comment.