diff --git a/assets/image/diipLogo.png b/assets/image/diipLogo.png new file mode 100644 index 000000000..6ee48c7c3 Binary files /dev/null and b/assets/image/diipLogo.png differ diff --git a/assets/image/dummy_linkedin_card.png b/assets/image/dummy_linkedin_card.png deleted file mode 100644 index c15a173bf..000000000 Binary files a/assets/image/dummy_linkedin_card.png and /dev/null differ diff --git a/assets/image/ebsi_logo.png b/assets/image/ebsi_logo.png index e2c1f63c3..3023dba8f 100644 Binary files a/assets/image/ebsi_logo.png and b/assets/image/ebsi_logo.png differ diff --git a/assets/image/linkedin_banner.png b/assets/image/linkedin_banner.png deleted file mode 100644 index 3a21a6012..000000000 Binary files a/assets/image/linkedin_banner.png and /dev/null differ diff --git a/assets/image/linkedin_card.png b/assets/image/linkedin_card.png deleted file mode 100644 index 21b5c9d01..000000000 Binary files a/assets/image/linkedin_card.png and /dev/null differ diff --git a/assets/image/owfBaselineProfileLogo.jpg b/assets/image/owfBaselineProfileLogo.jpg deleted file mode 100644 index 5ebd54dee..000000000 Binary files a/assets/image/owfBaselineProfileLogo.jpg and /dev/null differ diff --git a/lib/app/shared/constants/altme_strings.dart b/lib/app/shared/constants/altme_strings.dart index 467a86981..3096de011 100644 --- a/lib/app/shared/constants/altme_strings.dart +++ b/lib/app/shared/constants/altme_strings.dart @@ -1,7 +1,7 @@ class AltMeStrings { static const String defaultDIDMethod = 'key'; static const String cryptoTezosDIDMethod = 'pkh:tz'; - static const String cryptoEVMDIDMethod = 'pkh:eth'; + static const String cryptoEVMDIDMethod = 'key'; static const String defaultDIDMethodName = 'Tezos'; static const String databaseFilename = 'wallet.db'; static const String appContactWebsiteName = 'www.talao.io'; diff --git a/lib/app/shared/constants/image_strings.dart b/lib/app/shared/constants/image_strings.dart index 0c400da3b..fb4b8c62f 100644 --- a/lib/app/shared/constants/image_strings.dart +++ b/lib/app/shared/constants/image_strings.dart @@ -7,8 +7,7 @@ class ImageStrings { static const String imagePath = 'assets/image'; static const String ebsiLogo = '$imagePath/ebsi_logo.png'; - static const String owfBaselineProfileLogo = - '$imagePath/owfBaselineProfileLogo.jpg'; + static const String diipLogo = '$imagePath/diipLogo.png'; static const String cardMissing = '$imagePath/card_missing.png'; static const String employmentCertificateFront = @@ -56,7 +55,6 @@ class ImageStrings { '$imagePath/talao_community_card.png'; static const String verifiableIdCard = '$imagePath/verifiable_id_card.png'; - static const String linkedInCard = '$imagePath/linkedin_card.png'; static const String kycAgeCredentialCard = '$imagePath/kyc_age_credential_card.png'; static const String kycCountryOfResidenceCard = @@ -124,7 +122,6 @@ class ImageStrings { static const String dummyVerifiableIdCard = '$imagePath/dummy_verifiable_id_card.png'; - static const String dummyLinkedinCard = '$imagePath/dummy_linkedin_card.png'; static const String dummyPhonePassCard = '$imagePath/dummy_phone_pass_card.png'; @@ -156,8 +153,6 @@ class ImageStrings { static const String receiveSqure = '$imagePath/receive-square.png'; - static const String linkedInBanner = '$imagePath/linkedin_banner.png'; - static const String blankGetCard = '$imagePath/blank_transparent_get_card.png'; } diff --git a/lib/app/shared/constants/secure_storage_keys.dart b/lib/app/shared/constants/secure_storage_keys.dart index fc3a01279..841ef49fe 100644 --- a/lib/app/shared/constants/secure_storage_keys.dart +++ b/lib/app/shared/constants/secure_storage_keys.dart @@ -4,8 +4,6 @@ class SecureStorageKeys { static const String isFirstSelectedTokenContracts = 'isFirstSelectedTokenContracts'; static const String selectedContracts = 'selectedContracts'; - static const String lastNotifiedUNORewardId = 'lastNotifiedUNORewardId'; - static const String lastNotifiedXTZRewardId = 'lastNotifiedXTZRewardId'; static const String isIdentityEnabled = 'isIdentityEnabled'; static const String isProfessionalEnabled = 'isProfessionalEnabled'; static const String isCommunityEnabled = 'isCommunityEnabled'; diff --git a/lib/app/shared/constants/sizes.dart b/lib/app/shared/constants/sizes.dart index 63d4737e5..a3756bf85 100644 --- a/lib/app/shared/constants/sizes.dart +++ b/lib/app/shared/constants/sizes.dart @@ -27,7 +27,6 @@ abstract class Sizes { static const double largeRadius = 18; static const double credentialAspectRatio = 500 / 300; - static const double linkedinBannerAspectRatio = 1584 / 396; //Icon static const double iconXSmall = 12; diff --git a/lib/app/shared/constants/urls.dart b/lib/app/shared/constants/urls.dart index 36b24a324..7ec31b5d4 100644 --- a/lib/app/shared/constants/urls.dart +++ b/lib/app/shared/constants/urls.dart @@ -60,9 +60,6 @@ class Urls { /// twitter card static const String twitterCardUrl = 'https://issuer.talao.co/twitter/'; - /// linkedin card - static const String linkedinCardUrl = - 'https://issuer.talao.co/passbase/endpoint/linkedincard/'; // static const String talaoIpfsGafteway = 'https://talao.mypinata.cloud/ipfs/'; static const String ipfsGateway = 'https://ipfs.io/ipfs/'; diff --git a/lib/app/shared/enum/message/response_string/response_string.dart b/lib/app/shared/enum/message/response_string/response_string.dart index 5689802e5..04cfa7f3c 100644 --- a/lib/app/shared/enum/message/response_string/response_string.dart +++ b/lib/app/shared/enum/message/response_string/response_string.dart @@ -94,9 +94,6 @@ enum ResponseString { RESPONSE_STRING_verifiableIdCardExpirationDate, RESPONSE_STRING_verifiableIdCardHowToGetIt, RESPONSE_STRING_verifiableIdCardDummyDesc, - RESPONSE_STRING_linkedinCardWhyGetThisCard, - RESPONSE_STRING_linkedinCardExpirationDate, - RESPONSE_STRING_linkedinCardHowToGetIt, RESPONSE_STRING_phoneProofWhyGetThisCard, RESPONSE_STRING_phoneProofExpirationDate, RESPONSE_STRING_phoneProofHowToGetIt, @@ -116,7 +113,6 @@ enum ResponseString { RESPONSE_STRING_thisFeatureIsNotSupportedMessage, RESPONSE_STRING_userNotFitErrorMessage, RESPONSE_STRING_transactionIsLikelyToFail, - RESPONSE_STRING_linkedInBannerSuccessfullyExported, RESPONSE_STRING_credentialSuccessfullyExported, RESPONSE_STRING_livenessCardExpirationDate, RESPONSE_STRING_livenessCardWhyGetThisCard, diff --git a/lib/app/shared/enum/message/response_string/response_string_extension.dart b/lib/app/shared/enum/message/response_string/response_string_extension.dart index 9aa296a4c..ee825eab6 100644 --- a/lib/app/shared/enum/message/response_string/response_string_extension.dart +++ b/lib/app/shared/enum/message/response_string/response_string_extension.dart @@ -68,9 +68,6 @@ extension ResponseStringX on ResponseString { case ResponseString.RESPONSE_STRING_BACKUP_CREDENTIAL_SUCCESS_MESSAGE: return globalMessage.RESPONSE_STRING_BACKUP_CREDENTIAL_SUCCESS_MESSAGE; - case ResponseString.RESPONSE_STRING_linkedInBannerSuccessfullyExported: - return globalMessage.RESPONSE_STRING_linkedInBannerSuccessfullyExported; - case ResponseString.RESPONSE_STRING_credentialSuccessfullyExported: return globalMessage.RESPONSE_STRING_credentialSuccessfullyExported; @@ -299,15 +296,6 @@ extension ResponseStringX on ResponseString { case ResponseString.RESPONSE_STRING_verifiableIdCardHowToGetIt: return globalMessage.RESPONSE_STRING_verifiableIdCardHowToGetIt; - case ResponseString.RESPONSE_STRING_linkedinCardWhyGetThisCard: - return globalMessage.RESPONSE_STRING_linkedinCardWhyGetThisCard; - - case ResponseString.RESPONSE_STRING_linkedinCardExpirationDate: - return globalMessage.RESPONSE_STRING_linkedinCardExpirationDate; - - case ResponseString.RESPONSE_STRING_linkedinCardHowToGetIt: - return globalMessage.RESPONSE_STRING_linkedinCardHowToGetIt; - case ResponseString.RESPONSE_STRING_phoneProofWhyGetThisCard: return globalMessage.RESPONSE_STRING_phoneProofWhyGetThisCard; diff --git a/lib/app/shared/enum/type/blockchain_type.dart b/lib/app/shared/enum/type/blockchain_type.dart index 333f1f54f..b4772ee2e 100644 --- a/lib/app/shared/enum/type/blockchain_type.dart +++ b/lib/app/shared/enum/type/blockchain_type.dart @@ -1,4 +1,5 @@ import 'package:altme/app/app.dart'; +import 'package:altme/dashboard/dashboard.dart'; import 'package:credential_manifest/credential_manifest.dart'; import 'package:key_generator/key_generator.dart'; @@ -234,4 +235,28 @@ extension BlockchainTypeX on BlockchainType { return false; } } + + bool isSupported(ProfileSetting profileSetting) { + if (profileSetting.generalOptions.walletType != WalletAppType.altme) { + /// Only applies to altme + return true; + } + + final blockchainOptions = profileSetting.blockchainOptions; + + switch (this) { + case BlockchainType.tezos: + if (blockchainOptions?.tezosSupport ?? false) return true; + case BlockchainType.ethereum: + if (blockchainOptions?.ethereumSupport ?? false) return true; + case BlockchainType.fantom: + if (blockchainOptions?.fantomSupport ?? false) return true; + case BlockchainType.polygon: + if (blockchainOptions?.polygonSupport ?? false) return true; + case BlockchainType.binance: + if (blockchainOptions?.bnbSupport ?? false) return true; + } + + return false; + } } diff --git a/lib/app/shared/enum/type/credential_subject_type/credential_subject_type.dart b/lib/app/shared/enum/type/credential_subject_type/credential_subject_type.dart index 5acf6fd79..068e027e9 100644 --- a/lib/app/shared/enum/type/credential_subject_type/credential_subject_type.dart +++ b/lib/app/shared/enum/type/credential_subject_type/credential_subject_type.dart @@ -32,7 +32,6 @@ enum CredentialSubjectType { kycAgeCredential, kycCountryOfResidence, learningAchievement, - linkedInCard, nationality, over13, over15, diff --git a/lib/app/shared/enum/type/credential_subject_type/credential_subject_type_extension.dart b/lib/app/shared/enum/type/credential_subject_type/credential_subject_type_extension.dart index abdce2a98..cb27215c1 100644 --- a/lib/app/shared/enum/type/credential_subject_type/credential_subject_type_extension.dart +++ b/lib/app/shared/enum/type/credential_subject_type/credential_subject_type_extension.dart @@ -47,7 +47,6 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { case CredentialSubjectType.gender: case CredentialSubjectType.tezosAssociatedWallet: case CredentialSubjectType.verifiableIdCard: - case CredentialSubjectType.linkedInCard: case CredentialSubjectType.over13: case CredentialSubjectType.over15: case CredentialSubjectType.over18: @@ -140,8 +139,6 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { return 'IdentityPass'; case CredentialSubjectType.verifiableIdCard: return 'VerifiableId'; - case CredentialSubjectType.linkedInCard: - return 'LinkedinCard'; case CredentialSubjectType.learningAchievement: return 'LearningAchievement'; case CredentialSubjectType.over13: @@ -303,8 +300,6 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { return AragoOver18Model.fromJson(json); case CredentialSubjectType.pcdsAgentCertificate: return PcdsAgentCertificateModel.fromJson(json); - case CredentialSubjectType.linkedInCard: - return LinkedinCardModel.fromJson(json); case CredentialSubjectType.ethereumPooAddress: return EthereumPooAddressModel.fromJson(json); case CredentialSubjectType.fantomPooAddress: @@ -418,8 +413,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { this == CredentialSubjectType.ageRange || this == CredentialSubjectType.nationality || this == CredentialSubjectType.gender || - this == CredentialSubjectType.passportFootprint || - this == CredentialSubjectType.linkedInCard) { + this == CredentialSubjectType.passportFootprint) { return true; } return false; @@ -507,8 +501,6 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { return 'Identity Pass'; case CredentialSubjectType.verifiableIdCard: return 'VerifiableId'; - case CredentialSubjectType.linkedInCard: - return 'Linkedin Card'; case CredentialSubjectType.learningAchievement: return 'Learning Achievement'; case CredentialSubjectType.over13: @@ -622,7 +614,6 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { case CredentialSubjectType.certificateOfEmployment: case CredentialSubjectType.defaultCredential: case CredentialSubjectType.emailPass: - case CredentialSubjectType.linkedInCard: case CredentialSubjectType.learningAchievement: case CredentialSubjectType.phonePass: case CredentialSubjectType.professionalExperienceAssessment: @@ -670,7 +661,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { case CredentialSubjectType.defiCompliance: case CredentialSubjectType.tezotopiaMembership: case CredentialSubjectType.chainbornMembership: - return [VCFormatType.ldpVc]; + return [VCFormatType.ldpVc, VCFormatType.auto]; case CredentialSubjectType.verifiableIdCard: return [ @@ -678,12 +669,13 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { VCFormatType.jwtVcJson, VCFormatType.vcSdJWT, VCFormatType.jwtVc, + VCFormatType.auto, ]; case CredentialSubjectType.identityCredential: case CredentialSubjectType.eudiPid: case CredentialSubjectType.pid: - return [VCFormatType.vcSdJWT]; + return [VCFormatType.vcSdJWT, VCFormatType.auto]; case CredentialSubjectType.over18: case CredentialSubjectType.phonePass: @@ -692,6 +684,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { return [ VCFormatType.ldpVc, VCFormatType.jwtVcJson, + VCFormatType.auto, ]; case CredentialSubjectType.nationality: @@ -710,7 +703,6 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { case CredentialSubjectType.binancePooAddress: case CredentialSubjectType.certificateOfEmployment: case CredentialSubjectType.defaultCredential: - case CredentialSubjectType.linkedInCard: case CredentialSubjectType.learningAchievement: case CredentialSubjectType.professionalExperienceAssessment: case CredentialSubjectType.professionalSkillAssessment: @@ -731,7 +723,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { case CredentialSubjectType.civicPassCredential: case CredentialSubjectType.employeeCredential: case CredentialSubjectType.legalPersonalCredential: - return [VCFormatType.jwtVc]; + return [VCFormatType.jwtVc, VCFormatType.auto]; } } @@ -915,15 +907,6 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { ResponseString.RESPONSE_STRING_verifiableIdCardExpirationDate; howToGetIt = ResponseString.RESPONSE_STRING_verifiableIdCardHowToGetIt; - case CredentialSubjectType.linkedInCard: - image = ImageStrings.dummyLinkedinCard; - link = Urls.linkedinCardUrl; - whyGetThisCard = - ResponseString.RESPONSE_STRING_linkedinCardWhyGetThisCard; - expirationDateDetails = - ResponseString.RESPONSE_STRING_linkedinCardExpirationDate; - howToGetIt = ResponseString.RESPONSE_STRING_linkedinCardHowToGetIt; - case CredentialSubjectType.tezotopiaMembership: image = ImageStrings.tezotopiaMemberShipDummy; link = Urls.tezotopiaMembershipCardUrl; @@ -1105,8 +1088,6 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { return 90; case CredentialSubjectType.verifiableIdCard: return 97.5; - case CredentialSubjectType.linkedInCard: - return 86; case CredentialSubjectType.learningAchievement: return 0; case CredentialSubjectType.over13: diff --git a/lib/app/shared/enum/type/profile/profile_type.dart b/lib/app/shared/enum/type/profile/profile_type.dart index 6b2f2f300..21f239a49 100644 --- a/lib/app/shared/enum/type/profile/profile_type.dart +++ b/lib/app/shared/enum/type/profile/profile_type.dart @@ -1,32 +1,27 @@ -import 'package:altme/l10n/l10n.dart'; - enum ProfileType { defaultOne, ebsiV3, - dutch, - owfBaselineProfile, + diipv2point1, + diipv3, custom, enterprise, } extension ProfileTypeX on ProfileType { - String getTitle({ - required AppLocalizations l10n, - required String name, - }) { + String getTitle({required String name}) { switch (this) { case ProfileType.custom: - return l10n.profileCustom; + return 'Custom'; case ProfileType.ebsiV3: - return l10n.profileEbsiV3; - case ProfileType.dutch: - return l10n.decentralizedIdentityInteropProfile; + return 'European Blockchain Services Infrastructure'; + case ProfileType.diipv2point1: + return 'Decentralized Identity Interop Profile (DIIP v2.1)'; case ProfileType.enterprise: - return name.isEmpty ? l10n.enterprise : name; - case ProfileType.owfBaselineProfile: - return l10n.oWFBaselineProfile; + return name.isEmpty ? 'Enterprise' : name; + case ProfileType.diipv3: + return 'Decentralized Identity Interop Profile (DIIP v3.0)'; case ProfileType.defaultOne: - return l10n.defaultProfile; + return 'Default'; } } @@ -34,11 +29,11 @@ extension ProfileTypeX on ProfileType { switch (this) { case ProfileType.custom: case ProfileType.defaultOne: - case ProfileType.dutch: + case ProfileType.diipv2point1: return false; case ProfileType.ebsiV3: case ProfileType.enterprise: - case ProfileType.owfBaselineProfile: + case ProfileType.diipv3: return true; } } diff --git a/lib/app/shared/helper_functions/helper_functions.dart b/lib/app/shared/helper_functions/helper_functions.dart index 418ed63ff..702277f7b 100644 --- a/lib/app/shared/helper_functions/helper_functions.dart +++ b/lib/app/shared/helper_functions/helper_functions.dart @@ -1793,115 +1793,156 @@ List getStringCredentialsForToken({ required VCFormatType vcFormatType, required PresentationDefinition presentationDefinition, required Map? clientMetaData, + required List credentialsToBePresented, }) { bool presentLdpVc = false; bool presentJwtVc = false; bool presentJwtVcJson = false; bool presentVcSdJwt = false; - final supportingFormats = []; - - if (presentationDefinition.format != null) { - final format = presentationDefinition.format; + if (vcFormatType == VCFormatType.auto) { + final credential = credentialsToBePresented.firstOrNull; - /// ldp_vc - presentLdpVc = format?.ldpVc != null || format?.ldpVp != null; - - /// jwt_vc - presentJwtVc = format?.jwtVc != null || format?.jwtVp != null; + if (credential == null) { + throw ResponseMessage( + data: { + 'error': 'invalid_request', + 'error_description': 'VC format is missing', + }, + ); + } - /// jwt_vc_json - presentJwtVcJson = format?.jwtVcJson != null || format?.jwtVpJson != null; + final credentialFormat = credential.getFormat; - /// vc+sd-jwt - presentVcSdJwt = format?.vcSdJwt != null; + if (credentialFormat == VCFormatType.ldpVc.vcValue) { + presentLdpVc = true; + presentJwtVc = false; + presentJwtVcJson = false; + presentVcSdJwt = false; + } else if (credentialFormat == VCFormatType.jwtVc.vcValue) { + presentLdpVc = false; + presentJwtVc = true; + presentJwtVcJson = false; + presentVcSdJwt = false; + } else if (credentialFormat == VCFormatType.jwtVcJson.vcValue) { + presentLdpVc = false; + presentJwtVc = false; + presentJwtVcJson = true; + presentVcSdJwt = false; + } else if (credentialFormat == VCFormatType.vcSdJWT.vcValue) { + presentLdpVc = false; + presentJwtVc = false; + presentJwtVcJson = false; + presentVcSdJwt = true; + } } else { - if (clientMetaData == null) { - /// credential manifest case - if (vcFormatType == VCFormatType.ldpVc) { - presentLdpVc = true; - } else if (vcFormatType == VCFormatType.jwtVc) { - presentJwtVc = true; - } else if (vcFormatType == VCFormatType.jwtVcJson) { - presentJwtVcJson = true; - } else if (vcFormatType == VCFormatType.vcSdJWT) { - presentVcSdJwt = true; - } - } else { - final vpFormats = clientMetaData['vp_formats'] as Map; + final supportingFormats = []; + + if (presentationDefinition.format != null) { + final format = presentationDefinition.format; /// ldp_vc - presentLdpVc = vpFormats.containsKey('ldp_vc'); + presentLdpVc = format?.ldpVc != null || format?.ldpVp != null; /// jwt_vc - presentJwtVc = vpFormats.containsKey('jwt_vc'); + presentJwtVc = format?.jwtVc != null || format?.jwtVp != null; /// jwt_vc_json - presentJwtVcJson = vpFormats.containsKey('jwt_vc_json'); + presentJwtVcJson = format?.jwtVcJson != null || format?.jwtVpJson != null; /// vc+sd-jwt - presentVcSdJwt = vpFormats.containsKey('vc+sd-jwt'); + presentVcSdJwt = format?.vcSdJwt != null; + } else { + if (clientMetaData == null) { + /// credential manifest case + if (vcFormatType == VCFormatType.ldpVc) { + presentLdpVc = true; + } else if (vcFormatType == VCFormatType.jwtVc) { + presentJwtVc = true; + } else if (vcFormatType == VCFormatType.jwtVcJson) { + presentJwtVcJson = true; + } else if (vcFormatType == VCFormatType.vcSdJWT) { + presentVcSdJwt = true; + } + } else { + final vpFormats = clientMetaData['vp_formats'] as Map; + + /// ldp_vc + presentLdpVc = vpFormats.containsKey('ldp_vc'); + + /// jwt_vc + presentJwtVc = vpFormats.containsKey('jwt_vc'); + + /// jwt_vc_json + presentJwtVcJson = vpFormats.containsKey('jwt_vc_json'); + + /// vc+sd-jwt + presentVcSdJwt = vpFormats.containsKey('vc+sd-jwt'); + } + if (!presentLdpVc && vcFormatType == VCFormatType.ldpVc) { + presentLdpVc = true; + } else if (!presentJwtVc && vcFormatType == VCFormatType.jwtVc) { + presentJwtVc = true; + } else if (!presentJwtVcJson && vcFormatType == VCFormatType.jwtVcJson) { + presentJwtVcJson = true; + } else if (!presentVcSdJwt && vcFormatType == VCFormatType.vcSdJWT) { + presentVcSdJwt = true; + } + } + + if (!presentLdpVc && + !presentJwtVc && + !presentJwtVcJson && + !presentVcSdJwt) { + throw ResponseMessage( + data: { + 'error': 'invalid_request', + 'error_description': 'VC format is missing', + }, + ); } - if (!presentLdpVc && vcFormatType == VCFormatType.ldpVc) { + + /// create list of supported formats + if (presentLdpVc) supportingFormats.add(VCFormatType.ldpVc.vcValue); + if (presentJwtVc) supportingFormats.add(VCFormatType.jwtVc.vcValue); + if (presentJwtVcJson) supportingFormats.add(VCFormatType.jwtVcJson.vcValue); + if (presentVcSdJwt) supportingFormats.add(VCFormatType.vcSdJWT.vcValue); + + /// make sure only one of all are true + if (presentLdpVc && vcFormatType == VCFormatType.ldpVc) { presentLdpVc = true; - } else if (!presentJwtVc && vcFormatType == VCFormatType.jwtVc) { + presentJwtVc = false; + presentJwtVcJson = false; + presentVcSdJwt = false; + } else if (presentJwtVc && vcFormatType == VCFormatType.jwtVc) { + presentLdpVc = false; presentJwtVc = true; - } else if (!presentJwtVcJson && vcFormatType == VCFormatType.jwtVcJson) { + presentJwtVcJson = false; + presentVcSdJwt = false; + } else if (presentJwtVcJson && vcFormatType == VCFormatType.jwtVcJson) { + presentLdpVc = false; + presentJwtVc = false; presentJwtVcJson = true; - } else if (!presentVcSdJwt && vcFormatType == VCFormatType.vcSdJWT) { + presentVcSdJwt = false; + } else if (presentVcSdJwt && vcFormatType == VCFormatType.vcSdJWT) { + presentLdpVc = false; + presentJwtVc = false; + presentJwtVcJson = false; presentVcSdJwt = true; } - } - if (!presentLdpVc && !presentJwtVc && !presentJwtVcJson && !presentVcSdJwt) { - throw ResponseMessage( - data: { - 'error': 'invalid_request', - 'error_description': 'VC format is missing', - }, - ); - } - - /// create list of supported formats - if (presentLdpVc) supportingFormats.add(VCFormatType.ldpVc.vcValue); - if (presentJwtVc) supportingFormats.add(VCFormatType.jwtVc.vcValue); - if (presentJwtVcJson) supportingFormats.add(VCFormatType.jwtVcJson.vcValue); - if (presentVcSdJwt) supportingFormats.add(VCFormatType.jwtVcJson.vcValue); - - /// make sure only one of all are true - if (presentLdpVc && vcFormatType == VCFormatType.ldpVc) { - presentLdpVc = true; - presentJwtVc = false; - presentJwtVcJson = false; - presentVcSdJwt = false; - } else if (presentJwtVc && vcFormatType == VCFormatType.jwtVc) { - presentLdpVc = false; - presentJwtVc = true; - presentJwtVcJson = false; - presentVcSdJwt = false; - } else if (presentJwtVcJson && vcFormatType == VCFormatType.jwtVcJson) { - presentLdpVc = false; - presentJwtVc = false; - presentJwtVcJson = true; - presentVcSdJwt = false; - } else if (presentVcSdJwt && vcFormatType == VCFormatType.vcSdJWT) { - presentLdpVc = false; - presentJwtVc = false; - presentJwtVcJson = false; - presentVcSdJwt = true; - } - - if ((presentLdpVc && vcFormatType != VCFormatType.ldpVc) || - (presentJwtVc && vcFormatType != VCFormatType.jwtVc) || - presentJwtVcJson && vcFormatType != VCFormatType.jwtVcJson || - presentVcSdJwt && vcFormatType != VCFormatType.vcSdJWT) { - throw ResponseMessage( - data: { - 'error': 'invalid_request', - 'error_description': 'Please switch to profile that supports format ' - '${supportingFormats.join('/')}.', - }, - ); + if ((presentLdpVc && vcFormatType != VCFormatType.ldpVc) || + (presentJwtVc && vcFormatType != VCFormatType.jwtVc) || + presentJwtVcJson && vcFormatType != VCFormatType.jwtVcJson || + presentVcSdJwt && vcFormatType != VCFormatType.vcSdJWT) { + throw ResponseMessage( + data: { + 'error': 'invalid_request', + 'error_description': 'Please switch to profile that supports format ' + '${supportingFormats.join('/')}.', + }, + ); + } } return (presentLdpVc, presentJwtVc, presentJwtVcJson, presentVcSdJwt); diff --git a/lib/app/shared/message_handler/global_message.dart b/lib/app/shared/message_handler/global_message.dart index 43d0ff1a9..b9b28d4bd 100644 --- a/lib/app/shared/message_handler/global_message.dart +++ b/lib/app/shared/message_handler/global_message.dart @@ -109,9 +109,6 @@ class GlobalMessage { String get RESPONSE_STRING_BACKUP_CREDENTIAL_SUCCESS_MESSAGE => l10n.backupCredentialSuccessMessage; - String get RESPONSE_STRING_linkedInBannerSuccessfullyExported => - l10n.linkedInBannerSuccessfullyExported; - String get RESPONSE_STRING_credentialSuccessfullyExported => l10n.credentialSuccessfullyExported; @@ -271,12 +268,6 @@ class GlobalMessage { l10n.verifiableIdCardExpirationDate; String get RESPONSE_STRING_verifiableIdCardHowToGetIt => l10n.verifiableIdCardHowToGetIt; - String get RESPONSE_STRING_linkedinCardWhyGetThisCard => - l10n.linkedinCardWhyGetThisCard; - String get RESPONSE_STRING_linkedinCardExpirationDate => - l10n.linkedinCardExpirationDate; - String get RESPONSE_STRING_linkedinCardHowToGetIt => - l10n.linkedinCardHowToGetIt; String get RESPONSE_STRING_phoneProofWhyGetThisCard => l10n.phoneProofWhyGetThisCard; String get RESPONSE_STRING_phoneProofExpirationDate => diff --git a/lib/app/shared/message_handler/response_message.dart b/lib/app/shared/message_handler/response_message.dart index 44000641e..86846c8f9 100644 --- a/lib/app/shared/message_handler/response_message.dart +++ b/lib/app/shared/message_handler/response_message.dart @@ -99,11 +99,6 @@ class ResponseMessage with MessageHandler { .RESPONSE_STRING_BACKUP_CREDENTIAL_SUCCESS_MESSAGE .localise(context); - case ResponseString.RESPONSE_STRING_linkedInBannerSuccessfullyExported: - return ResponseString - .RESPONSE_STRING_linkedInBannerSuccessfullyExported - .localise(context); - case ResponseString.RESPONSE_STRING_credentialSuccessfullyExported: return ResponseString.RESPONSE_STRING_credentialSuccessfullyExported .localise(context); @@ -524,23 +519,6 @@ class ResponseMessage with MessageHandler { context, ); - case ResponseString.RESPONSE_STRING_linkedinCardWhyGetThisCard: - return ResponseString.RESPONSE_STRING_linkedinCardWhyGetThisCard - .localise( - context, - ); - - case ResponseString.RESPONSE_STRING_linkedinCardExpirationDate: - return ResponseString.RESPONSE_STRING_linkedinCardExpirationDate - .localise( - context, - ); - - case ResponseString.RESPONSE_STRING_linkedinCardHowToGetIt: - return ResponseString.RESPONSE_STRING_linkedinCardHowToGetIt.localise( - context, - ); - case ResponseString.RESPONSE_STRING_verifiableIdCardDummyDesc: return ResponseString.RESPONSE_STRING_verifiableIdCardDummyDesc .localise( diff --git a/lib/app/shared/widget/wallet_logo.dart b/lib/app/shared/widget/wallet_logo.dart index 6e1c1d75c..aec22abbf 100644 --- a/lib/app/shared/widget/wallet_logo.dart +++ b/lib/app/shared/widget/wallet_logo.dart @@ -26,7 +26,6 @@ class WalletLogo extends StatelessWidget { switch (profileModel.profileType) { case ProfileType.custom: - case ProfileType.dutch: case ProfileType.defaultOne: image = flavorCubit.state == FlavorMode.development ? ImageStrings.appLogoDev @@ -37,8 +36,9 @@ class WalletLogo extends StatelessWidget { image = ImageStrings.ebsiLogo; case ProfileType.enterprise: image = profileModel.profileSetting.generalOptions.companyLogo; - case ProfileType.owfBaselineProfile: - image = ImageStrings.owfBaselineProfileLogo; + case ProfileType.diipv2point1: + case ProfileType.diipv3: + image = ImageStrings.diipLogo; } return Column( children: [ diff --git a/lib/chat_room/matrix_chat/matrix_chat_impl.dart b/lib/chat_room/matrix_chat/matrix_chat_impl.dart index a750e8379..fad5f7c65 100644 --- a/lib/chat_room/matrix_chat/matrix_chat_impl.dart +++ b/lib/chat_room/matrix_chat/matrix_chat_impl.dart @@ -187,23 +187,32 @@ class MatrixChatImpl extends MatrixChatInterface { } if (event.messageType == 'm.text') { + final redactedBecause = event.unsigned?['redacted_because']; + message = TextMessage( id: event.unsigned?['transaction_id'] as String? ?? const Uuid().v4(), remoteId: event.eventId, - text: event.plaintextBody, + text: redactedBecause != null ? 'Message deleted' : event.plaintextBody, createdAt: event.originServerTs.millisecondsSinceEpoch, status: mapEventStatusToMessageStatus(event.status), - author: User( - id: event.senderId, - ), + author: User(id: event.senderId), ); } else if (event.messageType == 'm.image') { + final content = event.content; + + final file = content['file']; + + final url = + (file != null && file is Map) ? file['url'] : ''; + + final imageUrl = getUrlFromImage(url.toString()); + message = ImageMessage( id: const Uuid().v4(), remoteId: event.eventId, name: event.plaintextBody, size: size, - uri: getUrlFromUri(uri: event.content['url'] as String? ?? ''), + uri: imageUrl, status: mapEventStatusToMessageStatus(event.status), createdAt: event.originServerTs.millisecondsSinceEpoch, author: User( @@ -216,7 +225,7 @@ class MatrixChatImpl extends MatrixChatInterface { remoteId: event.eventId, name: event.plaintextBody, size: size, - uri: getUrlFromUri(uri: event.content['url'] as String? ?? ''), + uri: getUrlFromUri(url: event.content['url'] as String? ?? ''), status: mapEventStatusToMessageStatus(event.status), createdAt: event.originServerTs.millisecondsSinceEpoch, author: User( @@ -243,7 +252,7 @@ class MatrixChatImpl extends MatrixChatInterface { ), name: event.plaintextBody, size: size, - uri: getUrlFromUri(uri: event.content['url'] as String? ?? ''), + uri: getUrlFromUri(url: event.content['url'] as String? ?? ''), status: mapEventStatusToMessageStatus(event.status), createdAt: event.originServerTs.millisecondsSinceEpoch, author: User( @@ -462,12 +471,26 @@ class MatrixChatImpl extends MatrixChatInterface { @override String getUrlFromUri({ - required String uri, + required String url, int width = 500, int height = 500, }) { - if (uri.trim().isEmpty) return ''; - return '${Urls.matrixHomeServer}/_matrix/media/v3/thumbnail/${Urls.matrixHomeServer.replaceAll('https://', '')}/${uri.split('/').last}?width=$width&height=$height'; + if (url.trim().isEmpty) return ''; + final Uri uri = Uri.parse(url).getThumbnail( + client!, + height: height, + width: width, + animated: false, + ); + return uri.toString(); + } + + @override + String getUrlFromImage(String url) { + if (url.trim().isEmpty) return ''; + + final Uri uri = Uri.parse(url).getDownloadLink(client!); + return uri.toString(); } @override diff --git a/lib/chat_room/matrix_chat/matrix_chat_interface.dart b/lib/chat_room/matrix_chat/matrix_chat_interface.dart index 28cb8d606..680c1f319 100644 --- a/lib/chat_room/matrix_chat/matrix_chat_interface.dart +++ b/lib/chat_room/matrix_chat/matrix_chat_interface.dart @@ -29,10 +29,11 @@ abstract class MatrixChatInterface { Message mapEventToMessage(Event event); Status mapEventStatusToMessageStatus(EventStatus status); String getUrlFromUri({ - required String uri, + required String url, int width = 500, int height = 500, }); + String getUrlFromImage(String url); Future login({ required String username, required String password, diff --git a/lib/chat_room/view/chat_room_view.dart b/lib/chat_room/view/chat_room_view.dart index 974c68bc5..66cd2bfb9 100644 --- a/lib/chat_room/view/chat_room_view.dart +++ b/lib/chat_room/view/chat_room_view.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:altme/app/app.dart'; import 'package:altme/chat_room/chat_room.dart'; import 'package:altme/dashboard/dashboard.dart'; @@ -177,6 +179,27 @@ class _ChatRoomViewState extends State { ), ), messages: state.messages, + imageMessageBuilder: (p0, {required messageWidth}) { + final link = p0.uri; + + if (link.isEmpty) return Container(); + + if (link.startsWith('http')) { + return CachedImageFromNetwork( + link, + fit: BoxFit.contain, + width: 500, + height: 500, + ); + } else { + return Image.file( + File(link), + fit: BoxFit.contain, + width: 500, + height: 500, + ); + } + }, onSendPressed: (partialText) { FocusManager.instance.primaryFocus?.unfocus(); liveChatCubit!.onSendPressed(partialText); diff --git a/lib/credentials/cubit/credentials_cubit.dart b/lib/credentials/cubit/credentials_cubit.dart index 1176414a9..9c1f951d6 100644 --- a/lib/credentials/cubit/credentials_cubit.dart +++ b/lib/credentials/cubit/credentials_cubit.dart @@ -112,6 +112,7 @@ class CredentialsCubit extends Cubit { Future addWalletCredential({ required BlockchainType? blockchainType, + required QRCodeScanCubit qrCodeScanCubit, }) async { final log = getLogger('addRequiredCredentials'); @@ -175,6 +176,7 @@ class CredentialsCubit extends Cubit { credential: walletCredential, showMessage: false, blockchainType: blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); } } @@ -261,6 +263,7 @@ class CredentialsCubit extends Cubit { Future insertCredential({ required CredentialModel credential, required BlockchainType? blockchainType, + required QRCodeScanCubit qrCodeScanCubit, bool showMessage = true, bool showStatus = true, bool isPendingCredential = false, @@ -335,6 +338,10 @@ class CredentialsCubit extends Cubit { : null, ), ); + + if (qrCodeScanCubit.missingCredentialCompleter != null) { + qrCodeScanCubit.missingCredentialCompleter!.complete(true); + } } void enableCredentialCategory({required CredentialCategory category}) { @@ -503,6 +510,7 @@ class CredentialsCubit extends Cubit { Future insertAssociatedWalletCredential({ required CryptoAccountData cryptoAccountData, + required QRCodeScanCubit qrCodeScanCubit, }) async { final supportAssociatedCredential = supportCryptoCredential(profileCubit.state.model); @@ -549,6 +557,7 @@ class CredentialsCubit extends Cubit { await insertCredential( credential: credential, blockchainType: cryptoAccountData.blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); } } @@ -660,7 +669,7 @@ class CredentialsCubit extends Cubit { final vcFormatType = profileSetting .selfSovereignIdentityOptions.customOidc4vcProfile.vcFormatType; - final isDutchProfile = profileModel.profileType == ProfileType.dutch; + final isDutchProfile = profileModel.profileType == ProfileType.diipv2point1; final discoverCardsOptions = profileSetting.discoverCardsOptions; // entreprise user may have a list of external issuer @@ -685,6 +694,7 @@ class CredentialsCubit extends Cubit { .contains(CredentialSubjectType.over13)) { allSubjectTypeForCategory.add(CredentialSubjectType.over13); } + if (discoverCardsOptions.displayOver15 && !allSubjectTypeForCategory .contains(CredentialSubjectType.over15)) { @@ -693,10 +703,13 @@ class CredentialsCubit extends Cubit { if (!allSubjectTypeForCategory .contains(CredentialSubjectType.over18)) { - final displayOver18 = vcFormatType == VCFormatType.ldpVc && + final displayOver18 = (vcFormatType == VCFormatType.ldpVc || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayOver18; - final displayOver18Jwt = vcFormatType == VCFormatType.jwtVcJson && - discoverCardsOptions.displayOver18Jwt; + final displayOver18Jwt = + (vcFormatType == VCFormatType.jwtVcJson || + vcFormatType == VCFormatType.auto) && + discoverCardsOptions.displayOver18Jwt; if (isDutchProfile || displayOver18 || displayOver18Jwt) { allSubjectTypeForCategory.add(CredentialSubjectType.over18); @@ -721,14 +734,17 @@ class CredentialsCubit extends Cubit { if (!allSubjectTypeForCategory .contains(CredentialSubjectType.verifiableIdCard)) { - final displayVerifiableId = vcFormatType == VCFormatType.ldpVc && + final displayVerifiableId = (vcFormatType == VCFormatType.ldpVc || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayVerifiableId; final displayVerifiableIdJwt = (vcFormatType == VCFormatType.jwtVc || - vcFormatType == VCFormatType.jwtVcJson) && + vcFormatType == VCFormatType.jwtVcJson || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayVerifiableIdJwt; final displayVerifiableIdSdJwt = - vcFormatType == VCFormatType.vcSdJWT && + (vcFormatType == VCFormatType.vcSdJWT || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayVerifiableIdSdJwt; if (displayVerifiableId || @@ -753,10 +769,12 @@ class CredentialsCubit extends Cubit { if (!allSubjectTypeForCategory .contains(CredentialSubjectType.livenessCard)) { - final displayHumanity = vcFormatType == VCFormatType.ldpVc && + final displayHumanity = (vcFormatType == VCFormatType.ldpVc || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayHumanity; final displayHumanityJwt = - vcFormatType == VCFormatType.jwtVcJson && + (vcFormatType == VCFormatType.jwtVcJson || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayHumanityJwt; if (displayHumanity || displayHumanityJwt) { @@ -797,10 +815,12 @@ class CredentialsCubit extends Cubit { case CredentialCategory.contactInfoCredentials: if (!allSubjectTypeForCategory .contains(CredentialSubjectType.emailPass)) { - final displayEmailPass = vcFormatType == VCFormatType.ldpVc && + final displayEmailPass = (vcFormatType == VCFormatType.ldpVc || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayEmailPass; final displayEmailPassJwt = - vcFormatType == VCFormatType.jwtVcJson && + (vcFormatType == VCFormatType.jwtVcJson || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayEmailPassJwt; if (displayEmailPass || displayEmailPassJwt) { @@ -810,10 +830,12 @@ class CredentialsCubit extends Cubit { if (!allSubjectTypeForCategory .contains(CredentialSubjectType.phonePass)) { - final displayPhonePass = vcFormatType == VCFormatType.ldpVc && + final displayPhonePass = (vcFormatType == VCFormatType.ldpVc || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayPhonePass; final displayPhonePassJwt = - vcFormatType == VCFormatType.jwtVcJson && + (vcFormatType == VCFormatType.jwtVcJson || + vcFormatType == VCFormatType.auto) && discoverCardsOptions.displayPhonePassJwt; if (displayPhonePass || displayPhonePassJwt) { diff --git a/lib/credentials/cubit/credentials_helper_function.dart b/lib/credentials/cubit/credentials_helper_function.dart index 8a8c936b4..99603697f 100644 --- a/lib/credentials/cubit/credentials_helper_function.dart +++ b/lib/credentials/cubit/credentials_helper_function.dart @@ -29,13 +29,14 @@ Future generateAssociatedWalletCredential({ didMethod = AltMeStrings.cryptoEVMDIDMethod; } + log.i('didMethod - $didMethod'); + final String jwkKey = await keyGenerator.jwkFromSecretKey( secretKey: cryptoAccountData.secretKey, accountType: blockchainType.accountType, ); - final issuer = didKitProvider.keyToDID(didMethod, jwkKey); - log.i('didMethod - $didMethod'); + final String issuer = didKitProvider.keyToDID(didMethod, jwkKey); log.i('jwkKey - $jwkKey'); log.i('didKitProvider.keyToDID - $issuer'); @@ -54,9 +55,12 @@ Future generateAssociatedWalletCredential({ case BlockchainType.fantom: case BlockchainType.polygon: case BlockchainType.binance: - verificationMethod = '$issuer#Recovery2020'; + //verificationMethod = '$issuer#Recovery2020'; + verificationMethod = + await didKitProvider.keyToVerificationMethod(didMethod, jwkKey); } - log.i('hardcoded verificationMethod - $verificationMethod'); + + log.i('verificationMethod - $verificationMethod'); final options = { 'proofPurpose': 'assertionMethod', @@ -181,7 +185,7 @@ Future generateAssociatedWalletCredential({ oidc4vc: oidc4vc, privateKey: privateKey, kid: verificationMethod, - issuer: issuer, + did: did, ); } } else { @@ -193,7 +197,7 @@ Future generateAssociatedWalletCredential({ oidc4vc: oidc4vc, privateKey: privateKey, kid: verificationMethod, - issuer: issuer, + did: did, ); } } catch (e, s) { @@ -212,7 +216,7 @@ Future _createCredential({ required CustomOidc4VcProfile customOidc4vcProfile, required OIDC4VC oidc4vc, required Map privateKey, - required String issuer, + required String did, required String kid, String? oldId, }) async { @@ -240,13 +244,13 @@ Future _createCredential({ 'exp': iat + 1000, 'iss': jsonLd['issuer'], 'jti': jsonLd['id'] ?? 'urn:uuid:${const Uuid().v4()}', - 'sub': issuer, + 'sub': did, 'vc': jsonLd, }; final tokenParameters = TokenParameters( privateKey: privateKey, - did: issuer, + did: did, kid: kid, mediaType: MediaType.basic, clientType: customOidc4vcProfile.clientType, diff --git a/lib/dashboard/add_account/create_account/view/create_account_step1_page.dart b/lib/dashboard/add_account/create_account/view/create_account_step1_page.dart index 18f0ff967..77ccebaa5 100644 --- a/lib/dashboard/add_account/create_account/view/create_account_step1_page.dart +++ b/lib/dashboard/add_account/create_account/view/create_account_step1_page.dart @@ -1,3 +1,4 @@ +import 'package:altme/app/app.dart'; import 'package:altme/app/shared/constants/icon_strings.dart'; import 'package:altme/app/shared/constants/sizes.dart'; import 'package:altme/app/shared/widget/widget.dart'; @@ -6,6 +7,7 @@ import 'package:altme/l10n/l10n.dart'; import 'package:altme/onboarding/onboarding.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:key_generator/key_generator.dart'; class CreateAccountStep1Page extends StatelessWidget { @@ -40,72 +42,93 @@ class CreateAccountStep1View extends StatelessWidget { bottom: Sizes.spaceSmall, ), titleLeading: const BackLeadingButton(), - body: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const MStepper(totalStep: 2), - const SizedBox(height: Sizes.spaceNormal), - Text( - l10n.chooseABlockchainForAccountCreation, - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyMedium, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.tezosAccount, - subTitle: l10n.tezosAccountDescription, - imageAssetPath: IconStrings.tezos, - onTap: () { - Navigator.of(context).push( - CreateAccountStep2Page.route(accountType: AccountType.tezos), - ); - }, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.ethereumAccount, - subTitle: l10n.ethereumAccountDescription, - imageAssetPath: IconStrings.ethereum, - onTap: () { - Navigator.of(context).push( - CreateAccountStep2Page.route(accountType: AccountType.ethereum), - ); - }, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.fantomAccount, - subTitle: l10n.fantomAccountDescription, - imageAssetPath: IconStrings.fantom, - onTap: () { - Navigator.of(context).push( - CreateAccountStep2Page.route(accountType: AccountType.fantom), - ); - }, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.polygonAccount, - subTitle: l10n.polygonAccountDescription, - imageAssetPath: IconStrings.polygon, - onTap: () { - Navigator.of(context).push( - CreateAccountStep2Page.route(accountType: AccountType.polygon), - ); - }, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.binanceAccount, - subTitle: l10n.binanceAccountDescription, - imageAssetPath: IconStrings.binance, - onTap: () { - Navigator.of(context).push( - CreateAccountStep2Page.route(accountType: AccountType.binance), - ); - }, - ), - ], + body: BlocBuilder( + builder: (context, profileStae) { + final profileSetting = profileStae.model.profileSetting; + + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const MStepper(totalStep: 2), + const SizedBox(height: Sizes.spaceNormal), + Text( + l10n.chooseABlockchainForAccountCreation, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium, + ), + const SizedBox(height: Sizes.spaceNormal), + if (BlockchainType.tezos.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.tezosAccount, + subTitle: l10n.tezosAccountDescription, + imageAssetPath: IconStrings.tezos, + onTap: () { + Navigator.of(context).push( + CreateAccountStep2Page.route( + accountType: AccountType.tezos), + ); + }, + ), + const SizedBox(height: Sizes.spaceNormal), + ], + if (BlockchainType.ethereum.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.ethereumAccount, + subTitle: l10n.ethereumAccountDescription, + imageAssetPath: IconStrings.ethereum, + onTap: () { + Navigator.of(context).push( + CreateAccountStep2Page.route( + accountType: AccountType.ethereum), + ); + }, + ), + const SizedBox(height: Sizes.spaceNormal), + ], + if (BlockchainType.fantom.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.fantomAccount, + subTitle: l10n.fantomAccountDescription, + imageAssetPath: IconStrings.fantom, + onTap: () { + Navigator.of(context).push( + CreateAccountStep2Page.route( + accountType: AccountType.fantom), + ); + }, + ), + const SizedBox(height: Sizes.spaceNormal), + ], + if (BlockchainType.polygon.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.polygonAccount, + subTitle: l10n.polygonAccountDescription, + imageAssetPath: IconStrings.polygon, + onTap: () { + Navigator.of(context).push( + CreateAccountStep2Page.route( + accountType: AccountType.polygon), + ); + }, + ), + const SizedBox(height: Sizes.spaceNormal), + ], + if (BlockchainType.binance.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.binanceAccount, + subTitle: l10n.binanceAccountDescription, + imageAssetPath: IconStrings.binance, + onTap: () { + Navigator.of(context).push( + CreateAccountStep2Page.route( + accountType: AccountType.binance), + ); + }, + ), + ], + ], + ); + }, ), ); } diff --git a/lib/dashboard/add_account/import_account/view/import_account_step1_page.dart b/lib/dashboard/add_account/import_account/view/import_account_step1_page.dart index 6d5a12db9..462106124 100644 --- a/lib/dashboard/add_account/import_account/view/import_account_step1_page.dart +++ b/lib/dashboard/add_account/import_account/view/import_account_step1_page.dart @@ -1,11 +1,10 @@ -import 'package:altme/app/shared/constants/icon_strings.dart'; -import 'package:altme/app/shared/constants/sizes.dart'; -import 'package:altme/app/shared/widget/widget.dart'; +import 'package:altme/app/app.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:altme/onboarding/onboarding.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:key_generator/key_generator.dart'; class ImportAccountStep1Page extends StatelessWidget { @@ -40,72 +39,92 @@ class ImportAccountStep1View extends StatelessWidget { right: Sizes.spaceSmall, bottom: Sizes.spaceSmall, ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const MStepper(totalStep: 4, step: 1), - const SizedBox(height: Sizes.spaceNormal), - Text( - l10n.importEasilyFrom, - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyMedium, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.tezosAccount, - subTitle: l10n.tezosAccountDescription, - imageAssetPath: IconStrings.tezos, - onTap: () { - Navigator.of(context).push( - ImportAccountStep2Page.route(accountType: AccountType.tezos), - ); - }, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.ethereumAccount, - subTitle: l10n.ethereumAccountDescription, - imageAssetPath: IconStrings.ethereum, - onTap: () { - Navigator.of(context).push( - ImportAccountStep2Page.route(accountType: AccountType.ethereum), - ); - }, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.fantomAccount, - subTitle: l10n.fantomAccountDescription, - imageAssetPath: IconStrings.fantom, - onTap: () { - Navigator.of(context).push( - ImportAccountStep2Page.route(accountType: AccountType.fantom), - ); - }, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.polygonAccount, - subTitle: l10n.polygonAccountDescription, - imageAssetPath: IconStrings.polygon, - onTap: () { - Navigator.of(context).push( - ImportAccountStep2Page.route(accountType: AccountType.polygon), - ); - }, - ), - const SizedBox(height: Sizes.spaceNormal), - CustomListTileCard( - title: l10n.binanceAccount, - subTitle: l10n.binanceAccountDescription, - imageAssetPath: IconStrings.binance, - onTap: () { - Navigator.of(context).push( - ImportAccountStep2Page.route(accountType: AccountType.binance), - ); - }, - ), - ], + body: BlocBuilder( + builder: (context, profileStae) { + final profileSetting = profileStae.model.profileSetting; + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const MStepper(totalStep: 4, step: 1), + const SizedBox(height: Sizes.spaceNormal), + Text( + l10n.importEasilyFrom, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium, + ), + const SizedBox(height: Sizes.spaceNormal), + if (BlockchainType.tezos.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.tezosAccount, + subTitle: l10n.tezosAccountDescription, + imageAssetPath: IconStrings.tezos, + onTap: () { + Navigator.of(context).push( + ImportAccountStep2Page.route( + accountType: AccountType.tezos), + ); + }, + ), + const SizedBox(height: Sizes.spaceNormal), + ], + if (BlockchainType.ethereum.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.ethereumAccount, + subTitle: l10n.ethereumAccountDescription, + imageAssetPath: IconStrings.ethereum, + onTap: () { + Navigator.of(context).push( + ImportAccountStep2Page.route( + accountType: AccountType.ethereum), + ); + }, + ), + const SizedBox(height: Sizes.spaceNormal), + ], + if (BlockchainType.fantom.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.fantomAccount, + subTitle: l10n.fantomAccountDescription, + imageAssetPath: IconStrings.fantom, + onTap: () { + Navigator.of(context).push( + ImportAccountStep2Page.route( + accountType: AccountType.fantom), + ); + }, + ), + const SizedBox(height: Sizes.spaceNormal), + ], + if (BlockchainType.polygon.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.polygonAccount, + subTitle: l10n.polygonAccountDescription, + imageAssetPath: IconStrings.polygon, + onTap: () { + Navigator.of(context).push( + ImportAccountStep2Page.route( + accountType: AccountType.polygon), + ); + }, + ), + const SizedBox(height: Sizes.spaceNormal), + ], + if (BlockchainType.binance.isSupported(profileSetting)) ...[ + CustomListTileCard( + title: l10n.binanceAccount, + subTitle: l10n.binanceAccountDescription, + imageAssetPath: IconStrings.binance, + onTap: () { + Navigator.of(context).push( + ImportAccountStep2Page.route( + accountType: AccountType.binance), + ); + }, + ), + ], + ], + ); + }, ), ); } diff --git a/lib/dashboard/ai_age_verification/verify_age/view/camera_page.dart b/lib/dashboard/ai_age_verification/verify_age/view/camera_page.dart index 636d7a9c3..8a358c7a9 100644 --- a/lib/dashboard/ai_age_verification/verify_age/view/camera_page.dart +++ b/lib/dashboard/ai_age_verification/verify_age/view/camera_page.dart @@ -127,6 +127,7 @@ class _CameraViewState extends State { .currentAccount! .blockchainType, vcFormatType: customOidc4vcProfile.vcFormatType, + qrCodeScanCubit: context.read(), ); LoadingView().hide(); await Navigator.pushReplacement( diff --git a/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart b/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart index 2ee2efcbd..e9b51c6ba 100644 --- a/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart +++ b/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart @@ -75,6 +75,7 @@ class _CryptoBottomSheetPageState extends State { @override Widget build(BuildContext context) { final l10n = context.l10n; + return BlocConsumer( listener: (context, state) { if (state.status == AppStatus.loading) { @@ -150,36 +151,51 @@ class _CryptoBottomSheetPageState extends State { Radius.circular(Sizes.normalRadius), ), ), - child: ListView.separated( - itemCount: state.cryptoAccount.data.length, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, i) { - return CryptoAccountItem( - cryptoAccountData: - state.cryptoAccount.data[i], - isSelected: state.currentCryptoIndex == i, - listIndex: i, - onPressed: () { - context - .read() - .setCurrentWalletAccount(i); + child: BlocBuilder( + builder: (context, profileStae) { + final profileSetting = + profileStae.model.profileSetting; + + return ListView.separated( + itemCount: state.cryptoAccount.data.length, + shrinkWrap: true, + physics: + const NeverScrollableScrollPhysics(), + itemBuilder: (context, i) { + final data = state.cryptoAccount.data[i]; + + if (!data.blockchainType + .isSupported(profileSetting)) { + return Container(); + } + + return CryptoAccountItem( + cryptoAccountData: data, + isSelected: + state.currentCryptoIndex == i, + listIndex: i, + onPressed: () { + context + .read() + .setCurrentWalletAccount(i); + }, + onEditButtonPressed: () => _edit(i), + ); }, - onEditButtonPressed: () => _edit(i), + separatorBuilder: (_, __) => Padding( + padding: const EdgeInsets.symmetric( + horizontal: Sizes.spaceSmall, + ), + child: Divider( + height: 0.2, + color: Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.12), + ), + ), ); }, - separatorBuilder: (_, __) => Padding( - padding: const EdgeInsets.symmetric( - horizontal: Sizes.spaceSmall, - ), - child: Divider( - height: 0.2, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ), ), Container(height: 20), diff --git a/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart b/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart index 9655ff717..9cd411852 100644 --- a/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart +++ b/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart @@ -108,23 +108,32 @@ class _ManageAccountsPageState extends State { crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: [ - ListView.builder( - itemCount: state.cryptoAccount.data.length, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, i) { - return Padding( - padding: const EdgeInsets.all(8), - child: ManageAccountsItem( - cryptoAccountData: state.cryptoAccount.data[i], - listIndex: i, - onPressed: () { - context - .read() - .setCurrentWalletAccount(i); - }, - onEditButtonPressed: () => _edit(i), - ), + BlocBuilder( + builder: (context, profileStae) { + final profileSetting = profileStae.model.profileSetting; + return ListView.builder( + itemCount: state.cryptoAccount.data.length, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, i) { + final data = state.cryptoAccount.data[i]; + if (!data.blockchainType.isSupported(profileSetting)) { + return Container(); + } + return Padding( + padding: const EdgeInsets.all(8), + child: ManageAccountsItem( + cryptoAccountData: data, + listIndex: i, + onPressed: () { + context + .read() + .setCurrentWalletAccount(i); + }, + onEditButtonPressed: () => _edit(i), + ), + ); + }, ); }, ), diff --git a/lib/dashboard/drawer/profile/widget/profile_selector_widget.dart b/lib/dashboard/drawer/profile/widget/profile_selector_widget.dart index 34efedeef..9d401d67c 100644 --- a/lib/dashboard/drawer/profile/widget/profile_selector_widget.dart +++ b/lib/dashboard/drawer/profile/widget/profile_selector_widget.dart @@ -1,7 +1,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/credentials/cubit/credentials_cubit.dart'; import 'package:altme/dashboard/profile/profile.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:altme/wallet/wallet.dart'; import 'package:flutter/material.dart'; @@ -12,8 +11,6 @@ class ProfileSelectorWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; - final profile = context.read().state.model; final walletContainsEnterpriseProfile = @@ -44,7 +41,7 @@ class ProfileSelectorWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - l10n.walletProfilesDescription, + 'Choose your SSI profile or customize your own', style: Theme.of(context).textTheme.titleMedium, ), ], @@ -89,7 +86,6 @@ class ProfileSelectorWidget extends StatelessWidget { ), title: Text( profileType.getTitle( - l10n: l10n, name: profile.enterpriseWalletName ?? '', ), style: Theme.of(context).textTheme.bodyLarge, diff --git a/lib/dashboard/drawer/src/src.dart b/lib/dashboard/drawer/src/src.dart index 1e7a6add2..6ad0baa8b 100644 --- a/lib/dashboard/drawer/src/src.dart +++ b/lib/dashboard/drawer/src/src.dart @@ -1,3 +1,2 @@ -export 'view/check_linkedin_profile.dart'; export 'view/drawer_page.dart'; export 'widgets/widgets.dart'; diff --git a/lib/dashboard/drawer/src/view/check_linkedin_profile.dart b/lib/dashboard/drawer/src/view/check_linkedin_profile.dart deleted file mode 100644 index 57861ea6f..000000000 --- a/lib/dashboard/drawer/src/view/check_linkedin_profile.dart +++ /dev/null @@ -1,91 +0,0 @@ -import 'dart:convert'; - -import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; -import 'package:flutter/material.dart'; - -class CheckForLinkedInProfile extends StatelessWidget { - const CheckForLinkedInProfile({super.key}); - - static Route route() { - return MaterialPageRoute( - settings: const RouteSettings(name: '/CheckForLinkedInProfile'), - builder: (_) => const CheckForLinkedInProfile(), - ); - } - - @override - Widget build(BuildContext context) { - return const CheckForLinkedInProfileView(); - } -} - -class CheckForLinkedInProfileView extends StatelessWidget { - const CheckForLinkedInProfileView({super.key}); - - @override - Widget build(BuildContext context) { - final l10n = context.l10n; - return Drawer( - backgroundColor: Theme.of(context).colorScheme.surface, - child: SafeArea( - child: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const BackLeadingButton( - padding: EdgeInsets.zero, - ), - WalletLogo( - height: 90, - width: MediaQuery.of(context).size.shortestSide * 0.5, - showPoweredBy: true, - ), - DrawerItem( - title: l10n.scanAndDisplay, - onTap: () async { - final result = await Navigator.push( - context, - QrScannerPage.route(), - ); - if (result?.startsWith('{"@context"') ?? false) { - final Map data = - jsonDecode(result!) as Map; - - final Credential credentialPreview = Credential.fromJson( - data['verifiableCredential'] as Map, - ); - - final CredentialModel credentialModel = CredentialModel( - id: '', - credentialPreview: credentialPreview, - data: data['verifiableCredential'] - as Map, - image: '', - shareLink: '', - jwt: null, - format: 'ldp_vc', - ); - - await Navigator.of(context).push( - CredentialsDetailsPage.route( - credentialModel: credentialModel, - readOnly: true, - ), - ); - } else { - //invalid text - } - }, - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/dashboard/drawer/src/view/drawer_page.dart b/lib/dashboard/drawer/src/view/drawer_page.dart index 041df1d8f..49b1614f8 100644 --- a/lib/dashboard/drawer/src/view/drawer_page.dart +++ b/lib/dashboard/drawer/src/view/drawer_page.dart @@ -52,7 +52,6 @@ class DrawerView extends StatelessWidget { padding: EdgeInsets.zero, ), ), - const DrawerLogo(), const AppVersionDrawer(), const SizedBox(height: Sizes.spaceLarge), @@ -69,7 +68,6 @@ class DrawerView extends StatelessWidget { ), const SizedBox(height: Sizes.spaceSmall), ], - if (profileModel .profileSetting.settingsMenu.displayProfile) ...[ DrawerCategoryItem( @@ -82,7 +80,6 @@ class DrawerView extends StatelessWidget { ), const SizedBox(height: Sizes.spaceSmall), ], - DrawerCategoryItem( title: l10n.walletSecurity, subTitle: l10n.walletSecurityDescription, @@ -117,7 +114,6 @@ class DrawerView extends StatelessWidget { else const SizedBox.shrink(), const SizedBox(height: Sizes.spaceSmall), - if (profileModel.profileSetting.settingsMenu .displaySelfSovereignIdentity) ...[ DrawerCategoryItem( @@ -129,7 +125,6 @@ class DrawerView extends StatelessWidget { ), const SizedBox(height: Sizes.spaceSmall), ], - if (profileModel.profileSetting.settingsMenu .displayDeveloperMode) ...[ DrawerCategoryItem( @@ -156,17 +151,6 @@ class DrawerView extends StatelessWidget { ), const SizedBox(height: Sizes.spaceSmall), ], - - // DrawerCategoryItem( - // title: l10n.checkLinkedinProfile, - // subTitle: l10n.checkLinkedinProfile, - // onClick: () { - // Navigator.of(context) - // .push(CheckForLinkedInProfile.route()); - // }, - // ), - //const SizedBox(height: Sizes.spaceSmall), - if (profileModel .profileSetting.settingsMenu.displayHelpCenter) ...[ DrawerCategoryItem( @@ -179,7 +163,6 @@ class DrawerView extends StatelessWidget { ), const SizedBox(height: Sizes.spaceSmall), ], - DrawerCategoryItem( title: l10n.about, subTitle: l10n.aboutDescription, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/view/oidc4vc_settings_menu.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/view/oidc4vc_settings_menu.dart index f0b5a6433..c712edd42 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/view/oidc4vc_settings_menu.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/view/oidc4vc_settings_menu.dart @@ -2,7 +2,6 @@ import 'dart:convert'; import 'package:altme/app/app.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; class Oidc4vcSettingMenu extends StatelessWidget { @@ -26,9 +25,8 @@ class Oidc4vcSettingMenuView extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BasePage( - title: l10n.oidc4vc_settings, + title: 'OIDC4VC Settings', useSafeArea: true, scrollView: true, titleAlignment: Alignment.topCenter, @@ -51,28 +49,28 @@ class Oidc4vcSettingMenuView extends StatelessWidget { const PushAuthorizationRequesWidget(), const StatusListCachingWidget(), DrawerItem( - title: l10n.walletMetadataForIssuers, + title: 'Wallet metadata for issuers', onTap: () { final value = const JsonEncoder.withIndent(' ').convert( ConstantsJson.walletMetadataForIssuers, ); Navigator.of(context).push( JsonViewerPage.route( - title: l10n.walletMetadataForIssuers, + title: 'Wallet metadata for issuers', data: value, ), ); }, ), DrawerItem( - title: l10n.walletMetadataForVerifiers, + title: 'Wallet metadata for verifiers', onTap: () { final value = const JsonEncoder.withIndent(' ').convert( ConstantsJson.walletMetadataForVerifiers, ); Navigator.of(context).push( JsonViewerPage.route( - title: l10n.walletMetadataForVerifiers, + title: 'Wallet metadata for verifiers', data: value, ), ); diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_authentication_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_authentication_widget.dart index e8148c8b4..4d19ad27f 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_authentication_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_authentication_widget.dart @@ -1,7 +1,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:oidc4vc/oidc4vc.dart'; @@ -11,12 +10,13 @@ class ClientAuthenticationWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.clientAuthenticationMethods, - subtitle: l10n.clientAuthenticationMethodsSubtitle, + title: 'Client Authentication Methods', + subtitle: + 'Default: Client id as DID or JWK\nSelect to other authentication' + ' methods if needed.', body: ListView.builder( itemCount: ClientAuthentication.values.length, shrinkWrap: true, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_type_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_type_widget.dart index 097f5fea8..b13edcedd 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_type_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_type_widget.dart @@ -1,7 +1,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:oidc4vc/oidc4vc.dart'; @@ -11,12 +10,11 @@ class ClientTypeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.clientTypeTitle, - subtitle: l10n.clientTypeSubtitle, + title: 'Wallet Client_id Scheme', + subtitle: 'Confidential Client', body: ListView.builder( itemCount: ClientType.values.length, shrinkWrap: true, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/confidential_client_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/confidential_client_widget.dart index 50d68c5e1..51a6fa7ac 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/confidential_client_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/confidential_client_widget.dart @@ -1,6 +1,5 @@ import 'package:altme/app/shared/shared.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -10,7 +9,6 @@ class ConfidentialClientWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; final color = Theme.of(context).colorScheme.primary; final background = Theme.of(context).colorScheme.surface; final textColor = Theme.of(context).colorScheme.onSurface; @@ -30,7 +28,7 @@ class ConfidentialClientWidget extends StatelessWidget { final clientSecret = state.model.profileSetting .selfSovereignIdentityOptions.customOidc4vcProfile.clientSecret; return OptionContainer( - title: l10n.confidentialClient, + title: 'Confidential Client', body: Padding( padding: const EdgeInsets.symmetric(horizontal: 10), child: Column( @@ -86,7 +84,7 @@ class ConfidentialClientWidget extends StatelessWidget { height: Sizes.spaceNormal, ), MyElevatedButton( - text: l10n.confirm, + text: 'Confirm', verticalSpacing: 14, backgroundColor: color, borderRadius: Sizes.smallRadius, @@ -131,7 +129,7 @@ class ConfidentialClientWidget extends StatelessWidget { children: [ Expanded( child: Text( - '${l10n.clientId}: $clientId', + 'Client Id: $clientId', style: Theme.of(context).textTheme.titleMedium, ), ), @@ -196,7 +194,7 @@ class ConfidentialClientWidget extends StatelessWidget { height: Sizes.spaceNormal, ), MyElevatedButton( - text: l10n.confirm, + text: 'Confirm', verticalSpacing: 14, backgroundColor: color, borderRadius: Sizes.smallRadius, @@ -241,8 +239,7 @@ class ConfidentialClientWidget extends StatelessWidget { children: [ Expanded( child: Text( - '${l10n.clientSecret}: ' - '$clientSecret', + 'Client Secret: $clientSecret', style: Theme.of(context).textTheme.titleMedium, ), ), diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/cryptograhic_holder_binding.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/cryptograhic_holder_binding.dart index c5bb190b7..e7bccc67a 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/cryptograhic_holder_binding.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/cryptograhic_holder_binding.dart @@ -1,5 +1,4 @@ import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -8,12 +7,13 @@ class CryptographicHolderBindingWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.cryptographicHolderBinding, - subtitle: l10n.cryptographicHolderBindingSubtitle, + title: 'Cryptographic Holder Binding', + subtitle: + 'Default : On\nDisable cryptographic binding for claim based' + ' binding credentials.', body: Switch( onChanged: (value) async { await context.read().updateProfileSetting( diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/did_key_type_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/did_key_type_widget.dart index 4f09061a4..5c2012174 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/did_key_type_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/did_key_type_widget.dart @@ -1,7 +1,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:oidc4vc/oidc4vc.dart'; @@ -11,12 +10,11 @@ class DidKeyTypeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.defaultDid, - subtitle: l10n.selectOneOfTheDid, + title: 'Default DID', + subtitle: 'Select one of the DIDs', body: ListView.builder( itemCount: DidKeyType.values.length, shrinkWrap: true, @@ -47,9 +45,9 @@ class DidKeyTypeWidget extends StatelessWidget { if (isldpVc && isUnmatchedDid) { showDialog( context: context, - builder: (context) => ErrorDetailsDialog( - erroDescription: - l10n.theLdpFormatIsNotSupportedByThisDIDMethod, + builder: (context) => const ErrorDetailsDialog( + erroDescription: 'The ldp_format is not supported' + ' by this DID method.', ), ); diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart index 505694170..349ed25ae 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart @@ -1,7 +1,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:oidc4vc/oidc4vc.dart'; @@ -13,10 +12,9 @@ class DraftTypeWidget extends StatelessWidget { Widget build(BuildContext context) { return BlocBuilder( builder: (context, state) { - final l10n = context.l10n; return OptionContainer( title: 'OIDC4VCI', - subtitle: l10n.protocoleStandardRelease, + subtitle: 'Protocole standard release', body: ListView.builder( itemCount: OIDC4VCIDraftType.values.length, shrinkWrap: true, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_header_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_header_widget.dart index 56ac5496c..de7a74c0c 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_header_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_header_widget.dart @@ -1,7 +1,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:oidc4vc/oidc4vc.dart'; @@ -11,12 +10,11 @@ class ProofHeaderWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.proofHeader, - subtitle: l10n.proofHeaderSubtitle, + title: 'Proof of Possession Header', + subtitle: 'Default: kid\nSwitch if jwk is needed in header.', body: ListView.builder( itemCount: ProofHeaderType.values.length, shrinkWrap: true, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_type_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_type_widget.dart index 9fa25ddfc..3da7d0b92 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_type_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_type_widget.dart @@ -1,7 +1,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:oidc4vc/oidc4vc.dart'; @@ -11,12 +10,11 @@ class ProofTypeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.proofType, - subtitle: l10n.proofTypeSubtitle, + title: 'OIDC4VCI Proof Type', + subtitle: 'Default: jwt\nSelect one of the proof type.', body: ListView.builder( itemCount: ProofType.values.length, shrinkWrap: true, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/push_authorization_request.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/push_authorization_request.dart index 98b0b5cfb..3ad2e35ce 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/push_authorization_request.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/push_authorization_request.dart @@ -1,5 +1,4 @@ import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -8,12 +7,12 @@ class PushAuthorizationRequesWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.pushAuthorizationRequestTitle, - subtitle: l10n.pushAuthorizationRequestSubTitle, + title: 'Push Authorization Request (PAR)', + subtitle: + 'Default: false\nEnable to secure the authorization code flow', body: Switch( onChanged: (value) async { await context.read().updateProfileSetting( diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/scope_parameter.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/scope_parameter.dart index 8113bd563..be2f06a35 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/scope_parameter.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/scope_parameter.dart @@ -1,5 +1,4 @@ import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -8,12 +7,12 @@ class ScopeParameterWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.scopeParameters, - subtitle: l10n.scopeParametersSubtitle, + title: 'Scope Parameters', + subtitle: 'Default : Off\nEnable to force wallet to use scope' + ' instead of authorization_details.', body: Switch( onChanged: (value) async { await context.read().updateProfileSetting( diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/security_level_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/security_level_widget.dart index 890b526fa..9412985f0 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/security_level_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/security_level_widget.dart @@ -1,5 +1,4 @@ import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -8,12 +7,12 @@ class SecurityLevelWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.securityLevelTitle, - subtitle: l10n.securityLevelSubTitle, + title: 'Wallet Level', + subtitle: 'Default: Permissive\nSet to Strict to strengthen' + ' controls for issuers and verifiers', body: Switch( onChanged: (value) async { await context.read().updateProfileSetting( diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/status_list_caching_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/status_list_caching_widget.dart index 668dc317a..49991e815 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/status_list_caching_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/status_list_caching_widget.dart @@ -1,5 +1,4 @@ import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -8,12 +7,11 @@ class StatusListCachingWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.statusListCachingTitle, - subtitle: l10n.statusListCachingSubTitle, + title: 'StatusList caching', + subtitle: 'Default: On\nSwitch off to reload StatusList when needed', body: Switch( onChanged: (value) async { await context.read().updateProfileSetting( diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/vc_format_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/vc_format_widget.dart index a38edcd4c..245fc06ab 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/vc_format_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/vc_format_widget.dart @@ -1,7 +1,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:oidc4vc/oidc4vc.dart'; @@ -11,12 +10,11 @@ class VCFormatWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final l10n = context.l10n; return BlocBuilder( builder: (context, state) { return OptionContainer( - title: l10n.vcFormatType, - subtitle: l10n.vcFormatTypeSubtitle, + title: 'VC Format"', + subtitle: 'Default: ldp_vc\nSelect one of the VC formats.', body: ListView.builder( itemCount: VCFormatType.values.length, shrinkWrap: true, @@ -24,6 +22,11 @@ class VCFormatWidget extends StatelessWidget { padding: EdgeInsets.zero, itemBuilder: (context, index) { final vcFormatType = VCFormatType.values[index]; + + if (vcFormatType == VCFormatType.auto) { + return Container(); + } + return Column( children: [ ListTile( diff --git a/lib/dashboard/drawer/ssi/src/view/ssi_menu.dart b/lib/dashboard/drawer/ssi/src/view/ssi_menu.dart index 1745f4584..4fef21980 100644 --- a/lib/dashboard/drawer/ssi/src/view/ssi_menu.dart +++ b/lib/dashboard/drawer/ssi/src/view/ssi_menu.dart @@ -76,7 +76,7 @@ class SSIView extends StatelessWidget { if (context.read().state.model.profileType == ProfileType.custom) ...[ DrawerItem( - title: l10n.oidc4vc_settings, + title: 'OIDC4VC Settings', onTap: () { Navigator.of(context).push(Oidc4vcSettingMenu.route()); }, diff --git a/lib/dashboard/home/home/cubit/home_cubit.dart b/lib/dashboard/home/home/cubit/home_cubit.dart index e40e10b81..e72b4f464 100644 --- a/lib/dashboard/home/home/cubit/home_cubit.dart +++ b/lib/dashboard/home/home/cubit/home_cubit.dart @@ -5,6 +5,7 @@ import 'package:altme/app/app.dart'; import 'package:altme/credentials/credentials.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/dashboard/home/tab_bar/credentials/models/activity/activity.dart'; +import 'package:altme/dashboard/qr_code/qr_code.dart'; import 'package:bloc/bloc.dart'; import 'package:credential_manifest/credential_manifest.dart'; import 'package:crypto/crypto.dart'; @@ -44,6 +45,7 @@ class HomeCubit extends Cubit { required OIDC4VCIDraftType oidc4vciDraftType, required BlockchainType blockchainType, required VCFormatType vcFormatType, + required QRCodeScanCubit qrCodeScanCubit, }) async { // launch url to get Over18, Over15, Over13,Over21,Over50,Over65, // AgeRange Credentials @@ -101,6 +103,7 @@ class HomeCubit extends Cubit { oidc4vciDraftType: oidc4vciDraftType, blockchainType: blockchainType, vcFormatType: vcFormatType, + qrCodeScanCubit: qrCodeScanCubit, ); await ageEstimate( @@ -160,6 +163,7 @@ class HomeCubit extends Cubit { required OIDC4VCIDraftType oidc4vciDraftType, required BlockchainType blockchainType, required VCFormatType vcFormatType, + required QRCodeScanCubit qrCodeScanCubit, }) async { /// if credential of this type is already in the wallet do nothing /// Ensure credentialType = name of credential type in CredentialModel @@ -216,6 +220,7 @@ class HomeCubit extends Cubit { credential: credentialModel, showMessage: true, blockchainType: blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); await cameraCubit.incrementAcquiredCredentialsQuantity(); emit(state.copyWith(status: AppStatus.success)); diff --git a/lib/dashboard/home/home/cubit/home_state.dart b/lib/dashboard/home/home/cubit/home_state.dart index d48cd8b8f..fb2cb6325 100644 --- a/lib/dashboard/home/home/cubit/home_state.dart +++ b/lib/dashboard/home/home/cubit/home_state.dart @@ -7,7 +7,6 @@ class HomeState extends Equatable { this.message, this.homeStatus = HomeStatus.hasNoWallet, this.link, - this.tokenReward, this.data, }); @@ -18,14 +17,12 @@ class HomeState extends Equatable { final StateMessage? message; final HomeStatus homeStatus; final String? link; - final TokenReward? tokenReward; final dynamic data; HomeState loading() { return HomeState( status: AppStatus.loading, homeStatus: homeStatus, - tokenReward: null, link: link, ); } @@ -35,7 +32,6 @@ class HomeState extends Equatable { StateMessage? message, HomeStatus? homeStatus, String? link, - TokenReward? tokenReward, dynamic data, bool? needToVerifyMnemonics, }) { @@ -44,7 +40,6 @@ class HomeState extends Equatable { message: message, homeStatus: homeStatus ?? this.homeStatus, link: link ?? this.link, - tokenReward: tokenReward ?? this.tokenReward, data: data ?? this.data, ); } @@ -57,7 +52,6 @@ class HomeState extends Equatable { message, homeStatus, link, - tokenReward, data, ]; } diff --git a/lib/dashboard/home/home/home.dart b/lib/dashboard/home/home/home.dart index e11ddc3f4..72099b6b7 100644 --- a/lib/dashboard/home/home/home.dart +++ b/lib/dashboard/home/home/home.dart @@ -1,4 +1,3 @@ export 'cubit/home_cubit.dart'; -export 'models/models.dart'; export 'view/home_page.dart'; export 'widgets/widgets.dart'; diff --git a/lib/dashboard/home/home/models/models.dart b/lib/dashboard/home/home/models/models.dart deleted file mode 100644 index b188fd6ba..000000000 --- a/lib/dashboard/home/home/models/models.dart +++ /dev/null @@ -1 +0,0 @@ -export 'token_reward.dart'; diff --git a/lib/dashboard/home/home/models/token_reward.dart b/lib/dashboard/home/home/models/token_reward.dart deleted file mode 100644 index 876195396..000000000 --- a/lib/dashboard/home/home/models/token_reward.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'token_reward.g.dart'; - -@JsonSerializable() -class TokenReward extends Equatable { - const TokenReward({ - required this.amount, - required this.symbol, - required this.name, - required this.account, - required this.origin, - required this.txId, - required this.counter, - }); - - factory TokenReward.fromJson(Map json) => - _$TokenRewardFromJson(json); - - final double amount; - final String symbol; - final String name; - final String account; - final String origin; - final String txId; - final int counter; - - Map toJson() => _$TokenRewardToJson(this); - - @override - List get props => [ - amount, - symbol, - name, - account, - origin, - txId, - counter, - ]; -} diff --git a/lib/dashboard/home/home/view/home_page.dart b/lib/dashboard/home/home/view/home_page.dart index d3ff910ef..45808ec33 100644 --- a/lib/dashboard/home/home/view/home_page.dart +++ b/lib/dashboard/home/home/view/home_page.dart @@ -24,14 +24,6 @@ class HomePage extends StatelessWidget { } if (homeState.status == AppStatus.success) {} - - // if (homeState.status == AppStatus.gotTokenReward && - // homeState.tokenReward != null) { - // TokenRewardDialog.show( - // context: context, - // tokenReward: homeState.tokenReward!, - // ); - // } }, child: Parameters.walletHandlesCrypto ? const TabControllerPage() diff --git a/lib/dashboard/home/home/widgets/token_reward_dialog.dart b/lib/dashboard/home/home/widgets/token_reward_dialog.dart deleted file mode 100644 index 253b39423..000000000 --- a/lib/dashboard/home/home/widgets/token_reward_dialog.dart +++ /dev/null @@ -1,106 +0,0 @@ -import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/home/home/home.dart'; -import 'package:altme/l10n/l10n.dart'; - -import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; - -class TokenRewardDialog extends StatelessWidget { - const TokenRewardDialog({ - super.key, - required this.tokenReward, - }); - - final TokenReward tokenReward; - - static void show({ - required BuildContext context, - required TokenReward tokenReward, - }) { - showDialog( - context: context, - builder: (_) => TokenRewardDialog( - tokenReward: tokenReward, - ), - ); - } - - @override - Widget build(BuildContext context) { - final l10n = context.l10n; - return AlertDialog( - backgroundColor: Theme.of(context).colorScheme.surface, - surfaceTintColor: Colors.transparent, - contentPadding: const EdgeInsets.symmetric( - horizontal: Sizes.spaceNormal, - vertical: Sizes.spaceSmall, - ), - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(25)), - ), - content: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - const DialogCloseButton(), - const SizedBox(height: Sizes.spaceSmall), - Text( - l10n.rewardDialogTitle, - style: Theme.of(context).textTheme.headlineMedium!.copyWith( - color: Theme.of(context).colorScheme.primary, - ), - textAlign: TextAlign.center, - ), - const SizedBox(height: Sizes.spaceSmall), - Text.rich( - TextSpan( - text: l10n.rewardDialogDescPart1, - style: Theme.of(context).textTheme.bodyMedium, - children: [ - TextSpan( - text: - ''' ${tokenReward.amount.toString().formatNumber} ${tokenReward.symbol} ''', - style: Theme.of(context).textTheme.bodyMedium!.copyWith( - fontWeight: FontWeight.w900, - color: Theme.of(context).colorScheme.primary, - ), - ), - TextSpan( - text: '${l10n.rewardDialogDescPart2} : ', - ), - TextSpan( - text: - '''${tokenReward.account.substring(0, 6)}...${tokenReward.account.substring(tokenReward.account.length - 6)}''', - style: Theme.of(context).textTheme.bodyMedium!.copyWith( - decoration: TextDecoration.underline, - ), - recognizer: TapGestureRecognizer() - ..onTap = () { - LaunchUrl.launch( - 'https://tzkt.io/${tokenReward.txId}/${tokenReward.counter}', - ); - }, - ), - TextSpan( - text: '\n\n${l10n.origin}: ${tokenReward.origin}', - ), - ], - ), - ), - const SizedBox(height: Sizes.spaceSmall), - MyElevatedButton( - text: l10n.gotIt.toUpperCase(), - verticalSpacing: 18, - fontSize: 18, - borderRadius: 20, - backgroundColor: Theme.of(context).colorScheme.primary, - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ), - ), - ); - } -} diff --git a/lib/dashboard/home/home/widgets/widgets.dart b/lib/dashboard/home/home/widgets/widgets.dart index 5652dc6c0..40ea6d025 100644 --- a/lib/dashboard/home/home/widgets/widgets.dart +++ b/lib/dashboard/home/home/widgets/widgets.dart @@ -1,4 +1,3 @@ export 'get_cards_widget.dart'; export 'qr_icon.dart'; -export 'token_reward_dialog.dart'; export 'wallet_dialog.dart'; diff --git a/lib/dashboard/home/tab_bar/credentials/credential.dart b/lib/dashboard/home/tab_bar/credentials/credential.dart index e03ddebae..db94c8021 100644 --- a/lib/dashboard/home/tab_bar/credentials/credential.dart +++ b/lib/dashboard/home/tab_bar/credentials/credential.dart @@ -2,7 +2,6 @@ export 'card_chat_support/card_chat_support.dart'; export 'credential_qr/credential_qr.dart'; export 'detail/credentials_detail.dart'; export 'helper_functions/helper_functions.dart'; -export 'linkedin_credential/linkedin_credential.dart'; export 'list/credentials_list.dart'; export 'models/model.dart'; export 'oid4c4vc_pick/oid4c4vc_pick.dart'; diff --git a/lib/dashboard/home/tab_bar/credentials/detail/cubit/credential_details_cubit.dart b/lib/dashboard/home/tab_bar/credentials/detail/cubit/credential_details_cubit.dart index 8140c124d..410e3cc65 100644 --- a/lib/dashboard/home/tab_bar/credentials/detail/cubit/credential_details_cubit.dart +++ b/lib/dashboard/home/tab_bar/credentials/detail/cubit/credential_details_cubit.dart @@ -202,7 +202,8 @@ class CredentialDetailsCubit extends Cubit { // revoked emit( state.copyWith( - credentialStatus: CredentialStatus.invalidStatus, + credentialStatus: + CredentialStatus.statusListInvalidSignature, status: AppStatus.idle, statusListIndex: statusListIndex, statusListUrl: statusListUri, diff --git a/lib/dashboard/home/tab_bar/credentials/detail/view/credentials_details_page.dart b/lib/dashboard/home/tab_bar/credentials/detail/view/credentials_details_page.dart index aaaabc18e..9167427a3 100644 --- a/lib/dashboard/home/tab_bar/credentials/detail/view/credentials_details_page.dart +++ b/lib/dashboard/home/tab_bar/credentials/detail/view/credentials_details_page.dart @@ -70,7 +70,6 @@ class CredentialsDetailsPage extends StatelessWidget { ], child: CredentialsDetailsView( credentialModel: credentialModel, - readOnly: readOnly, cardChatSupportCubit: cardChatSupportCubit, ), ); @@ -81,12 +80,10 @@ class CredentialsDetailsView extends StatefulWidget { const CredentialsDetailsView({ super.key, required this.credentialModel, - required this.readOnly, required this.cardChatSupportCubit, }); final CredentialModel credentialModel; - final bool readOnly; final CardChatSupportCubit? cardChatSupportCubit; @override @@ -194,7 +191,7 @@ class _CredentialsDetailsViewState extends State { context.read().state.model.profileSetting; return BasePage( - title: widget.readOnly ? l10n.linkedInProfile : l10n.cardDetails, + title: l10n.cardDetails, titleAlignment: Alignment.topCenter, titleLeading: const BackLeadingButton(), padding: const EdgeInsets.symmetric(horizontal: 10), @@ -235,20 +232,19 @@ class _CredentialsDetailsViewState extends State { ), ), ), - if (!widget.readOnly) - Expanded( - child: CredentialDetailTabbar( - isSelected: state - .credentialDetailTabStatus == - CredentialDetailTabStatus.activity, - title: l10n.credentialDetailsActivity, - onTap: () => context - .read() - .changeTabStatus( + Expanded( + child: CredentialDetailTabbar( + isSelected: + state.credentialDetailTabStatus == CredentialDetailTabStatus.activity, - ), - ), + title: l10n.credentialDetailsActivity, + onTap: () => context + .read() + .changeTabStatus( + CredentialDetailTabStatus.activity, + ), ), + ), if (widget.cardChatSupportCubit != null) Expanded( child: StreamBuilder( @@ -392,110 +388,93 @@ class _CredentialsDetailsViewState extends State { ), ], ), - navigation: widget.readOnly - ? null - : SafeArea( - child: Container( - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 5, + navigation: SafeArea( + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 5, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + MyOutlinedButton( + onPressed: + widget.credentialModel.disAllowDelete ? null : delete, + text: l10n.credentialDetailDeleteCard, + ), + const SizedBox(height: 8), + if (widget.credentialModel.pendingInfo == null) ...[ + if (isDeveloperMode) + MyOutlinedButton( + text: l10n.download, + onPressed: () { + if (widget.credentialModel.isEbsiCard) { + /// removing type that was added in add_ebsi_credential.dart + widget.credentialModel.data['credentialSubject'] + .remove('type'); + } + + late String data; + final String? jwt = widget.credentialModel.jwt; + if (jwt != null) { + data = jwt; + } else { + data = jsonEncode(widget.credentialModel.data); + } + + getLogger( + 'CredentialDetailsPage - shared date', + ).i(data); + + final box = context.findRenderObject() as RenderBox?; + final subject = l10n.shareWith; + + Share.share( + data, + subject: subject, + sharePositionOrigin: + box!.localToGlobal(Offset.zero) & box.size, + ); + }, + ), + ] else ...[ + MyOutlinedButton( + text: l10n.getItNow, + onPressed: () { + Navigator.of(context).pop(); + context + .read() + .startOIDC4VCDeferedCredentialIssuance( + credentialModel: widget.credentialModel, + qrCodeScanCubit: context.read(), + ); + }, ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - MyOutlinedButton( - onPressed: widget.credentialModel.disAllowDelete - ? null - : delete, - text: l10n.credentialDetailDeleteCard, - ), - const SizedBox(height: 8), - if (widget.credentialModel.pendingInfo == null) ...[ - if (isDeveloperMode) - MyOutlinedButton( - text: widget.credentialModel.isLinkeInCard - ? l10n.exportToLinkedIn - : l10n.download, - onPressed: () { - if (widget.credentialModel.isLinkeInCard) { - Navigator.of(context).push( - GetLinkedinInfoPage.route( - credentialModel: widget.credentialModel, - ), - ); - } else { - if (widget.credentialModel.isEbsiCard) { - /// removing type that was added in add_ebsi_credential.dart - widget.credentialModel - .data['credentialSubject'] - .remove('type'); - } - - late String data; - final String? jwt = - widget.credentialModel.jwt; - if (jwt != null) { - data = jwt; - } else { - data = - jsonEncode(widget.credentialModel.data); - } - - getLogger( - 'CredentialDetailsPage - shared date', - ).i(data); - - final box = - context.findRenderObject() as RenderBox?; - final subject = l10n.shareWith; - - Share.share( - data, - subject: subject, - sharePositionOrigin: - box!.localToGlobal(Offset.zero) & - box.size, - ); - } - }, - ), - ] else ...[ - MyOutlinedButton( - text: l10n.getItNow, - onPressed: () { - Navigator.of(context).pop(); - context - .read() - .startOIDC4VCDeferedCredentialIssuance( - credentialModel: widget.credentialModel, - ); - }, + ], + if (widget.credentialModel.shareLink != '') + MyOutlinedButton.icon( + icon: SvgPicture.asset( + IconStrings.qrCode, + width: 24, + height: 24, + color: Theme.of(context).colorScheme.onPrimary, + ), + onPressed: () { + Navigator.of(context).push( + QrCodeDisplayPage.route( + title: '', + data: widget.credentialModel.shareLink, ), - ], - if (widget.credentialModel.shareLink != '') - MyOutlinedButton.icon( - icon: SvgPicture.asset( - IconStrings.qrCode, - width: 24, - height: 24, - color: Theme.of(context).colorScheme.onPrimary, - ), - onPressed: () { - Navigator.of(context).push( - QrCodeDisplayPage.route( - title: '', - data: widget.credentialModel.shareLink, - ), - ); - }, - text: l10n.credentialDetailShare, - ) - else - Container(), - ], - ), - ), - ), + ); + }, + text: l10n.credentialDetailShare, + ) + else + Container(), + ], + ), + ), + ), ); }, ); 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 11fa32783..79d062db2 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 @@ -15,12 +15,14 @@ Future discoverCredential({ if (dummyCredential.credentialSubjectType.isBlockchainAccount) { final credentialCubit = context.read(); final walletCubit = context.read(); + final qrCodeScanCubit = context.read(); final cryptoAccountData = walletCubit.state.currentAccount; if (cryptoAccountData != null) { await credentialCubit.insertAssociatedWalletCredential( cryptoAccountData: cryptoAccountData, + qrCodeScanCubit: qrCodeScanCubit, ); } diff --git a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/cubit/generate_linkedin_qr_cubit.dart b/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/cubit/generate_linkedin_qr_cubit.dart deleted file mode 100644 index c6a628fdd..000000000 --- a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/cubit/generate_linkedin_qr_cubit.dart +++ /dev/null @@ -1,142 +0,0 @@ -import 'dart:convert'; - -import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/dashboard.dart'; -import 'package:did_kit/did_kit.dart'; -import 'package:equatable/equatable.dart'; -import 'package:file_saver/file_saver.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:json_annotation/json_annotation.dart'; -import 'package:oidc4vc/oidc4vc.dart'; -import 'package:secure_storage/secure_storage.dart'; -import 'package:uuid/uuid.dart'; - -part 'generate_linkedin_qr_cubit.g.dart'; -part 'generate_linkedin_qr_state.dart'; - -class GenerateLinkedInQrCubit extends Cubit { - GenerateLinkedInQrCubit({ - required this.didKitProvider, - required this.secureStorageProvider, - required this.fileSaver, - required this.profileCubit, - required this.oidc4vc, - }) : super(const GenerateLinkedInQrState()); - - final DIDKitProvider didKitProvider; - final SecureStorageProvider secureStorageProvider; - final FileSaver fileSaver; - final ProfileCubit profileCubit; - final OIDC4VC oidc4vc; - - Future generatePresentationForLinkedInCard({ - required String linkedInUrl, - required CredentialModel credentialModel, - }) async { - final log = getLogger( - 'GenerateLinkedInQrCubit - generatePresentationForLinkedInCard', - ); - try { - emit(state.loading()); - - final presentationId = 'urn:uuid:${const Uuid().v4()}'; - - final didKeyType = profileCubit.state.model.profileSetting - .selfSovereignIdentityOptions.customOidc4vcProfile.defaultDid; - - final privateKey = await getPrivateKey( - profileCubit: profileCubit, - didKeyType: didKeyType, - ); - - final (did, kid) = await getDidAndKid( - didKeyType: didKeyType, - privateKey: privateKey, - profileCubit: profileCubit, - ); - - final presentation = await didKitProvider.issuePresentation( - jsonEncode({ - '@context': ['https://www.w3.org/2018/credentials/v1'], - 'type': ['VerifiablePresentation'], - 'id': presentationId, - 'holder': did, - 'verifiableCredential': credentialModel.data, - }), - jsonEncode({ - 'verificationMethod': kid, - 'proofPurpose': 'assertionMethod', - 'challenge': credentialModel.challenge, - 'domain': linkedInUrl, - }), - privateKey, - ); - - emit(state.copyWith(status: AppStatus.idle, qrValue: presentation)); - } catch (e) { - log.e('something went wrong - $e'); - if (e is ResponseMessage) { - emit(state.error(messageHandler: e)); - } else { - emit( - state.error( - messageHandler: ResponseMessage( - message: ResponseString - .RESPONSE_STRING_SOMETHING_WENT_WRONG_TRY_AGAIN_LATER, - ), - ), - ); - } - } - } - - Future saveScreenshot(Uint8List capturedImage) async { - emit(state.loading()); - final isPermissionStatusGranted = await getStoragePermission(); - - try { - if (!isPermissionStatusGranted) { - throw ResponseMessage( - message: ResponseString.STORAGE_PERMISSION_DENIED_MESSAGE, - ); - } - final dateTime = getDateTimeWithoutSpace(); - final fileName = 'linkedin-banner-$dateTime'; - - final filePath = await fileSaver.saveAs( - name: fileName, - bytes: capturedImage, - ext: 'png', - mimeType: MimeType.png, - ); - - if (filePath != null && filePath.isEmpty) { - emit(state.copyWith(status: AppStatus.idle)); - } else { - emit( - state.copyWith( - status: AppStatus.success, - messageHandler: ResponseMessage( - message: ResponseString - .RESPONSE_STRING_linkedInBannerSuccessfullyExported, - ), - ), - ); - } - } catch (e) { - if (e is MessageHandler) { - emit(state.error(messageHandler: e)); - } else { - emit( - state.error( - messageHandler: ResponseMessage( - message: ResponseString - .RESPONSE_STRING_SOMETHING_WENT_WRONG_TRY_AGAIN_LATER, - ), - ), - ); - } - } - } -} diff --git a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/cubit/generate_linkedin_qr_state.dart b/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/cubit/generate_linkedin_qr_state.dart deleted file mode 100644 index 5ff101c6b..000000000 --- a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/cubit/generate_linkedin_qr_state.dart +++ /dev/null @@ -1,50 +0,0 @@ -part of 'generate_linkedin_qr_cubit.dart'; - -@JsonSerializable() -class GenerateLinkedInQrState extends Equatable { - const GenerateLinkedInQrState({ - this.status = AppStatus.init, - this.message, - this.qrValue, - }); - - factory GenerateLinkedInQrState.fromJson(Map json) => - _$GenerateLinkedInQrStateFromJson(json); - - final AppStatus status; - final StateMessage? message; - final String? qrValue; - - GenerateLinkedInQrState loading() { - return GenerateLinkedInQrState( - status: AppStatus.loading, - qrValue: qrValue, - ); - } - - GenerateLinkedInQrState error({required MessageHandler messageHandler}) { - return GenerateLinkedInQrState( - status: AppStatus.error, - message: StateMessage.error(messageHandler: messageHandler), - ); - } - - GenerateLinkedInQrState copyWith({ - required AppStatus status, - MessageHandler? messageHandler, - String? qrValue, - }) { - return GenerateLinkedInQrState( - status: status, - message: messageHandler == null - ? null - : StateMessage.success(messageHandler: messageHandler), - qrValue: qrValue ?? this.qrValue, - ); - } - - Map toJson() => _$GenerateLinkedInQrStateToJson(this); - - @override - List get props => [status, message, qrValue]; -} diff --git a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/generate_linkedin_qr.dart b/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/generate_linkedin_qr.dart deleted file mode 100644 index d651b5774..000000000 --- a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/generate_linkedin_qr.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'cubit/generate_linkedin_qr_cubit.dart'; -export 'view/generate_linkedin_qr_page.dart'; diff --git a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/view/generate_linkedin_qr_page.dart b/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/view/generate_linkedin_qr_page.dart deleted file mode 100644 index 0b6dcbb2b..000000000 --- a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/generate_linkedin_qr/view/generate_linkedin_qr_page.dart +++ /dev/null @@ -1,196 +0,0 @@ -import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; -import 'package:did_kit/did_kit.dart'; -import 'package:file_saver/file_saver.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:oidc4vc/oidc4vc.dart'; -import 'package:pretty_qr_code/pretty_qr_code.dart'; -import 'package:screenshot/screenshot.dart'; -import 'package:secure_storage/secure_storage.dart'; - -class GenerateLinkedinQrPage extends StatelessWidget { - const GenerateLinkedinQrPage({ - super.key, - required this.linkedinUrl, - required this.credentialModel, - }); - - final CredentialModel credentialModel; - final String linkedinUrl; - - static Route route({ - required String linkedinUrl, - required CredentialModel credentialModel, - }) { - return MaterialPageRoute( - settings: const RouteSettings(name: '/GenerateLinkedinQrPage'), - builder: (_) => GenerateLinkedinQrPage( - linkedinUrl: linkedinUrl, - credentialModel: credentialModel, - ), - ); - } - - @override - Widget build(BuildContext context) { - return BlocProvider( - create: (_) => GenerateLinkedInQrCubit( - didKitProvider: DIDKitProvider(), - secureStorageProvider: getSecureStorage, - fileSaver: FileSaver.instance, - profileCubit: context.read(), - oidc4vc: OIDC4VC(), - ), - child: GenerateLinkedinQrView( - linkedinUrl: linkedinUrl, - credentialModel: credentialModel, - ), - ); - } -} - -class GenerateLinkedinQrView extends StatefulWidget { - const GenerateLinkedinQrView({ - super.key, - required this.linkedinUrl, - required this.credentialModel, - }); - - final CredentialModel credentialModel; - final String linkedinUrl; - - @override - State createState() => _GenerateLinkedinQrViewState(); -} - -class _GenerateLinkedinQrViewState extends State { - ScreenshotController screenshotController = ScreenshotController(); - - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addPostFrameCallback((_) { - context - .read() - .generatePresentationForLinkedInCard( - linkedInUrl: widget.linkedinUrl, - credentialModel: widget.credentialModel, - ); - }); - } - - @override - Widget build(BuildContext context) { - final l10n = context.l10n; - return BasePage( - title: l10n.linkedInBanner, - titleAlignment: Alignment.topCenter, - titleLeading: const BackLeadingButton(), - scrollView: false, - padding: const EdgeInsets.symmetric(horizontal: 5), - body: BlocConsumer( - listener: (context, state) { - if (state.status == AppStatus.loading) { - LoadingView().show(context: context); - } else { - LoadingView().hide(); - } - - if (state.message != null) { - AlertMessage.showStateMessage( - context: context, - stateMessage: state.message!, - ); - } - - if (state.status == AppStatus.success) { - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - }, - builder: (context, state) { - return Center( - child: Screenshot( - controller: screenshotController, - child: AspectRatio( - aspectRatio: Sizes.linkedinBannerAspectRatio, - child: DecoratedBox( - decoration: const BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage(ImageStrings.linkedInBanner), - ), - ), - child: CustomMultiChildLayout( - delegate: QrDelegate(position: Offset.zero), - children: [ - LayoutId( - id: 'qr', - child: state.qrValue == null - ? Container() - : FractionallySizedBox( - heightFactor: 0.48, - widthFactor: 0.12, - child: PrettyQrView.data( - data: state.qrValue!, - errorCorrectLevel: QrErrorCorrectLevel.M, - ), - ), - ), - ], - ), - ), - ), - ), - ); - }, - ), - navigation: Padding( - padding: const EdgeInsets.all(Sizes.spaceSmall), - child: MyElevatedButton( - text: l10n.exportToLinkedIn, - onPressed: () async { - final log = - getLogger('GenerateLinkedinQrView - screenshotController'); - await screenshotController - .capture(delay: const Duration(milliseconds: 10)) - .then((capturedImage) { - context - .read() - .saveScreenshot(capturedImage!); - }).catchError((dynamic onError) { - log.e(onError); - AlertMessage.showStateMessage( - context: context, - stateMessage: StateMessage.error( - stringMessage: l10n.somethingsWentWrongTryAgainLater, - ), - ); - }); - }, - ), - ), - ); - } -} - -class QrDelegate extends MultiChildLayoutDelegate { - QrDelegate({this.position = Offset.zero}); - - final Offset position; - - @override - void performLayout(Size size) { - if (hasChild('qr')) { - layoutChild('qr', BoxConstraints.loose(size)); - positionChild('qr', Offset(size.width * 0.8175, size.height * 0.185)); - } - } - - @override - bool shouldRelayout(QrDelegate oldDelegate) { - return oldDelegate.position != position; - } -} diff --git a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/cubit/get_linkedin_info_cubit.dart b/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/cubit/get_linkedin_info_cubit.dart deleted file mode 100644 index 8e96da427..000000000 --- a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/cubit/get_linkedin_info_cubit.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'get_linkedin_info_cubit.g.dart'; -part 'get_linkedin_info_state.dart'; - -class GetLinkedinInfoCubit extends Cubit { - GetLinkedinInfoCubit() : super(const GetLinkedinInfoState()); - - void isUrlValid(String value) { - final RegExp linkedInRegex = - RegExp(r'^(https:\/\/)(www\.)?linkedin\.com\/in\/[a-zA-Z0-9-]+(\/)?$'); - - emit( - state.copyWith( - isTextFieldEdited: value.isNotEmpty, - isLinkedUrlValid: linkedInRegex.hasMatch(value), - ), - ); - } -} diff --git a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/cubit/get_linkedin_info_state.dart b/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/cubit/get_linkedin_info_state.dart deleted file mode 100644 index 92653bad5..000000000 --- a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/cubit/get_linkedin_info_state.dart +++ /dev/null @@ -1,33 +0,0 @@ -part of 'get_linkedin_info_cubit.dart'; - -@JsonSerializable() -class GetLinkedinInfoState extends Equatable { - const GetLinkedinInfoState({ - this.isTextFieldEdited = false, - this.isLinkedUrlValid = false, - }); - - factory GetLinkedinInfoState.fromJson(Map json) => - _$GetLinkedinInfoStateFromJson(json); - - final bool isTextFieldEdited; - final bool isLinkedUrlValid; - - GetLinkedinInfoState copyWith({ - bool? isTextFieldEdited, - bool? isLinkedUrlValid, - }) { - return GetLinkedinInfoState( - isTextFieldEdited: isTextFieldEdited ?? this.isTextFieldEdited, - isLinkedUrlValid: isLinkedUrlValid ?? this.isLinkedUrlValid, - ); - } - - Map toJson() => _$GetLinkedinInfoStateToJson(this); - - @override - List get props => [ - isLinkedUrlValid, - isTextFieldEdited, - ]; -} diff --git a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/get_linkedin_info.dart b/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/get_linkedin_info.dart deleted file mode 100644 index 43e329e19..000000000 --- a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/get_linkedin_info.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'cubit/get_linkedin_info_cubit.dart'; -export 'view/get_linkedin_info_page.dart'; diff --git a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/view/get_linkedin_info_page.dart b/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/view/get_linkedin_info_page.dart deleted file mode 100644 index b9449e69f..000000000 --- a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/get_linkedin_info/view/get_linkedin_info_page.dart +++ /dev/null @@ -1,152 +0,0 @@ -import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/l10n/l10n.dart'; - -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; - -class GetLinkedinInfoPage extends StatelessWidget { - const GetLinkedinInfoPage({ - super.key, - required this.credentialModel, - }); - - final CredentialModel credentialModel; - - static Route route({required CredentialModel credentialModel}) { - return MaterialPageRoute( - settings: const RouteSettings(name: '/GetLinkedinInfoPage'), - builder: (_) => GetLinkedinInfoPage(credentialModel: credentialModel), - ); - } - - @override - Widget build(BuildContext context) { - return BlocProvider( - create: (_) => GetLinkedinInfoCubit(), - child: GetLinkedinInfoView(credentialModel: credentialModel), - ); - } -} - -class GetLinkedinInfoView extends StatefulWidget { - const GetLinkedinInfoView({ - super.key, - required this.credentialModel, - }); - - final CredentialModel credentialModel; - - @override - State createState() => _GetLinkedinInfoViewState(); -} - -class _GetLinkedinInfoViewState extends State { - late TextEditingController linkedInUrlController; - - @override - void initState() { - super.initState(); - linkedInUrlController = TextEditingController(); - linkedInUrlController.addListener(() { - context - .read() - .isUrlValid(linkedInUrlController.text); - }); - } - - @override - Widget build(BuildContext context) { - final l10n = context.l10n; - return BasePage( - title: l10n.addLinkedInInfo, - titleAlignment: Alignment.topCenter, - titleLeading: const BackLeadingButton(), - padding: const EdgeInsets.only( - top: 0, - left: Sizes.spaceSmall, - right: Sizes.spaceSmall, - bottom: Sizes.spaceSmall, - ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SizedBox(height: Sizes.spaceNormal), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: Sizes.spaceLarge, - ), - child: Text( - l10n.whatsYourLinkedinProfileUrl, - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.titleLarge?.copyWith( - letterSpacing: 1.2, - ), - ), - ), - const SizedBox(height: Sizes.spaceLarge), - BlocBuilder( - builder: (context, state) { - return Stack( - alignment: Alignment.bottomRight, - fit: StackFit.loose, - children: [ - BaseTextField( - height: 100, - hint: 'e.g. https://www.linkedin.com/john.doe', - fillColor: Colors.transparent, - hintStyle: Theme.of(context).textTheme.bodyMedium, - maxLines: 3, - borderRadius: Sizes.normalRadius, - controller: linkedInUrlController, - error: state.isTextFieldEdited && !state.isLinkedUrlValid - ? l10n.invalidUrlError - : null, - ), - if (state.isLinkedUrlValid) - Container( - alignment: Alignment.center, - width: Sizes.icon2x, - height: Sizes.icon2x, - padding: const EdgeInsets.all(2), - margin: const EdgeInsets.all(Sizes.spaceNormal), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).colorScheme.onTertiary, - ), - child: const Icon( - Icons.check, - size: Sizes.icon, - color: Colors.white, - ), - ), - ], - ); - }, - ), - const SizedBox(height: Sizes.spaceSmall), - ], - ), - navigation: Padding( - padding: const EdgeInsets.all(Sizes.spaceSmall), - child: BlocBuilder( - builder: (context, state) { - return MyElevatedButton( - text: l10n.exportToLinkedIn, - onPressed: !state.isLinkedUrlValid - ? null - : () { - Navigator.of(context).push( - GenerateLinkedinQrPage.route( - linkedinUrl: linkedInUrlController.text, - credentialModel: widget.credentialModel, - ), - ); - }, - ); - }, - ), - ), - ); - } -} diff --git a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/linkedin_credential.dart b/lib/dashboard/home/tab_bar/credentials/linkedin_credential/linkedin_credential.dart deleted file mode 100644 index 066f0bc8a..000000000 --- a/lib/dashboard/home/tab_bar/credentials/linkedin_credential/linkedin_credential.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'generate_linkedin_qr/generate_linkedin_qr.dart'; -export 'get_linkedin_info/get_linkedin_info.dart'; diff --git a/lib/dashboard/home/tab_bar/credentials/list/widgets/home_credential_category_list.dart b/lib/dashboard/home/tab_bar/credentials/list/widgets/home_credential_category_list.dart index b16f00312..1c7e3da60 100644 --- a/lib/dashboard/home/tab_bar/credentials/list/widgets/home_credential_category_list.dart +++ b/lib/dashboard/home/tab_bar/credentials/list/widgets/home_credential_category_list.dart @@ -75,6 +75,11 @@ class HomeCredentialCategoryList extends StatelessWidget { } } + if (customOidc4vcProfile.vcFormatType.vcValue == + VCFormatType.auto.vcValue) { + return true; + } + /// do not load the credential if vc format is different if (customOidc4vcProfile.vcFormatType.vcValue != element.getFormat) { diff --git a/lib/dashboard/home/tab_bar/credentials/models/credential_model/credential_model.dart b/lib/dashboard/home/tab_bar/credentials/models/credential_model/credential_model.dart index 48bb41e05..0011a8119 100644 --- a/lib/dashboard/home/tab_bar/credentials/models/credential_model/credential_model.dart +++ b/lib/dashboard/home/tab_bar/credentials/models/credential_model/credential_model.dart @@ -233,10 +233,6 @@ class CredentialModel extends Equatable { credentialPreview.credentialSubjectModel.credentialSubjectType == CredentialSubjectType.defaultCredential; - bool get isLinkeInCard => - credentialPreview.credentialSubjectModel.credentialSubjectType == - CredentialSubjectType.linkedInCard; - bool get isEbsiCard => credentialPreview.credentialSubjectModel.credentialSubjectType.isEbsiCard; diff --git a/lib/dashboard/home/tab_bar/credentials/models/linkedin_card/linkedin_card_model.dart b/lib/dashboard/home/tab_bar/credentials/models/linkedin_card/linkedin_card_model.dart deleted file mode 100644 index a8ea2141e..000000000 --- a/lib/dashboard/home/tab_bar/credentials/models/linkedin_card/linkedin_card_model.dart +++ /dev/null @@ -1,40 +0,0 @@ -import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/dashboard.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'linkedin_card_model.g.dart'; - -@JsonSerializable(explicitToJson: true) -class LinkedinCardModel extends CredentialSubjectModel { - LinkedinCardModel({ - this.familyName, - this.givenName, - this.bithPlace, - this.birthDate, - this.addressCountry, - super.issuedBy, - super.offeredBy, - super.id, - super.type, - }) : super( - credentialSubjectType: CredentialSubjectType.linkedInCard, - credentialCategory: CredentialCategory.socialMediaCards, - ); - - factory LinkedinCardModel.fromJson(Map json) => - _$LinkedinCardModelFromJson(json); - - @JsonKey(defaultValue: '') - String? familyName; - @JsonKey(defaultValue: '') - String? givenName; - @JsonKey(defaultValue: '') - String? birthDate; - @JsonKey(defaultValue: '') - String? bithPlace; - @JsonKey(defaultValue: '') - String? addressCountry; - - @override - Map toJson() => _$LinkedinCardModelToJson(this); -} diff --git a/lib/dashboard/home/tab_bar/credentials/models/model.dart b/lib/dashboard/home/tab_bar/credentials/models/model.dart index 8db784a5d..26ae6adc9 100644 --- a/lib/dashboard/home/tab_bar/credentials/models/model.dart +++ b/lib/dashboard/home/tab_bar/credentials/models/model.dart @@ -39,7 +39,6 @@ export 'kyc_age_credential/kyc_age_credential_model.dart'; export 'kyc_country_of_residence/kyc_country_of_residence_model.dart'; export 'learning_achievement/learning_achievement_model.dart'; export 'legal_person_credential/legal_person_credential_model.dart'; -export 'linkedin_card/linkedin_card_model.dart'; export 'liveness_card/liveness_card_model.dart'; export 'nationality/nationality_model.dart'; export 'over13/over13_model.dart'; diff --git a/lib/dashboard/home/tab_bar/credentials/oid4c4vc_pick/oid4c4vc_credential_pick/view/oid4c4vc_credential_pick_page.dart b/lib/dashboard/home/tab_bar/credentials/oid4c4vc_pick/oid4c4vc_credential_pick/view/oid4c4vc_credential_pick_page.dart index 033ae203e..97e94a9c8 100644 --- a/lib/dashboard/home/tab_bar/credentials/oid4c4vc_pick/oid4c4vc_credential_pick/view/oid4c4vc_credential_pick_page.dart +++ b/lib/dashboard/home/tab_bar/credentials/oid4c4vc_pick/oid4c4vc_credential_pick/view/oid4c4vc_credential_pick_page.dart @@ -199,6 +199,8 @@ class Oidc4vcCredentialPickView extends StatelessWidget { preAuthorizedCode: preAuthorizedCode, isEBSIV3: isEBSIV3, credentialOfferJson: credentialOfferJson, + qrCodeScanCubit: + context.read(), ); }, text: l10n.proceed, diff --git a/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_credential_offer/view/polygon_id_credential_offer_view.dart b/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_credential_offer/view/polygon_id_credential_offer_view.dart index c67074da1..eb56b2380 100644 --- a/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_credential_offer/view/polygon_id_credential_offer_view.dart +++ b/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_credential_offer/view/polygon_id_credential_offer_view.dart @@ -146,7 +146,9 @@ class PolygonIdCredentialOfferPage extends StatelessWidget { context: context, localAuthApi: LocalAuthApi(), onSuccess: () { - context.read().addPolygonIdCredentials(); + context.read().addPolygonIdCredentials( + qrCodeScanCubit: context.read(), + ); }, ); }, diff --git a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/helpers/filter_credential_list_by_format.dart b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/helpers/filter_credential_list_by_format.dart index ae526544c..c9c891da8 100644 --- a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/helpers/filter_credential_list_by_format.dart +++ b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/helpers/filter_credential_list_by_format.dart @@ -10,6 +10,10 @@ List filterCredenialListByFormat({ required PresentationDefinition presentationDefinition, required List filterList, }) { + if (vcFormatType == VCFormatType.auto) { + return credentialList; + } + final credentials = List.from(credentialList); if (filterList.isNotEmpty) { final isJwtVpInJwtVCRequired = presentationDefinition.format?.jwtVp != null; @@ -25,6 +29,7 @@ List filterCredenialListByFormat({ clientMetaData: clientMetaData, presentationDefinition: presentationDefinition, vcFormatType: vcFormatType, + credentialsToBePresented: credentials, ); credentials.removeWhere( diff --git a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/view/credential_manifest_credential_offer_pick_page.dart b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/view/credential_manifest_credential_offer_pick_page.dart index 5f3f349cd..368745eab 100644 --- a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/view/credential_manifest_credential_offer_pick_page.dart +++ b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/view/credential_manifest_credential_offer_pick_page.dart @@ -93,16 +93,6 @@ class CredentialManifestOfferPickView extends StatelessWidget { Widget build(BuildContext context) { final l10n = context.l10n; - final isVcSdJWT = context - .read() - .state - .model - .profileSetting - .selfSovereignIdentityOptions - .customOidc4vcProfile - .vcFormatType == - VCFormatType.vcSdJWT; - return BlocConsumer( listener: (context, state) { @@ -117,6 +107,10 @@ class CredentialManifestOfferPickView extends StatelessWidget { final PresentationDefinition? presentationDefinition = credentialManifestState.presentationDefinition; + final isVcSdJWT = credentialManifestState + .filteredCredentialList.firstOrNull?.getFormat == + VCFormatType.vcSdJWT.vcValue; + return BlocListener( listener: (context, scanState) { if (scanState.status == ScanStatus.loading) { diff --git a/lib/dashboard/home/tab_bar/credentials/receive/view/credentials_receive_page.dart b/lib/dashboard/home/tab_bar/credentials/receive/view/credentials_receive_page.dart index 86dc3018f..415e3f903 100644 --- a/lib/dashboard/home/tab_bar/credentials/receive/view/credentials_receive_page.dart +++ b/lib/dashboard/home/tab_bar/credentials/receive/view/credentials_receive_page.dart @@ -143,12 +143,13 @@ class _CredentialsReceivePageState extends State { ); } else { context.read().credentialOfferOrPresent( - uri: widget.uri, - credentialModel: credentialModel, - keyId: SecureStorageKeys.ssiKey, - issuer: widget.issuer, - credentialsToBePresented: [], - ); + uri: widget.uri, + credentialModel: credentialModel, + keyId: SecureStorageKeys.ssiKey, + issuer: widget.issuer, + credentialsToBePresented: [], + qrCodeScanCubit: context.read(), + ); } }, ), diff --git a/lib/dashboard/home/tab_bar/credentials/widgets/credential_display.dart b/lib/dashboard/home/tab_bar/credentials/widgets/credential_display.dart index a0d7f7f72..075068317 100644 --- a/lib/dashboard/home/tab_bar/credentials/widgets/credential_display.dart +++ b/lib/dashboard/home/tab_bar/credentials/widgets/credential_display.dart @@ -137,9 +137,6 @@ class CredentialDisplay extends StatelessWidget { case CredentialSubjectType.verifiableIdCard: return VerifiableIdCardWidget(credentialModel: credentialModel); - case CredentialSubjectType.linkedInCard: - return LinkedinCardWidget(credentialModel: credentialModel); - case CredentialSubjectType.euDiplomaCard: return EUDiplomaCardWidget(credentialModel: credentialModel); diff --git a/lib/dashboard/home/tab_bar/credentials/widgets/credential_widget/credential_widget.dart b/lib/dashboard/home/tab_bar/credentials/widgets/credential_widget/credential_widget.dart index bf62101bb..3540c1586 100644 --- a/lib/dashboard/home/tab_bar/credentials/widgets/credential_widget/credential_widget.dart +++ b/lib/dashboard/home/tab_bar/credentials/widgets/credential_widget/credential_widget.dart @@ -28,7 +28,6 @@ export 'identity_pass_widget.dart'; export 'kyc_age_credential_widget.dart'; export 'kyc_country_of_residence_widget.dart'; export 'learning_achievement_widget.dart'; -export 'linkedin_card_widget.dart'; export 'liveness_card_widget.dart'; export 'my_blockchain_account_base_widget.dart'; export 'nationality_widget.dart'; diff --git a/lib/dashboard/home/tab_bar/credentials/widgets/credential_widget/linkedin_card_widget.dart b/lib/dashboard/home/tab_bar/credentials/widgets/credential_widget/linkedin_card_widget.dart deleted file mode 100644 index 3cf5c99cf..000000000 --- a/lib/dashboard/home/tab_bar/credentials/widgets/credential_widget/linkedin_card_widget.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/dashboard.dart'; -import 'package:flutter/material.dart'; - -class LinkedinCardWidget extends StatelessWidget { - const LinkedinCardWidget({ - super.key, - required this.credentialModel, - }); - - final CredentialModel credentialModel; - - @override - Widget build(BuildContext context) { - return CredentialBaseWidget( - cardBackgroundImagePath: ImageStrings.linkedInCard, - issuerName: credentialModel - .credentialPreview.credentialSubjectModel.issuedBy?.name, - value: '', - issuanceDate: UiDate.formatDateForCredentialCard( - credentialModel.credentialPreview.issuanceDate, - ), - expirationDate: credentialModel.expirationDate == null - ? '--' - : UiDate.formatDateForCredentialCard( - credentialModel.expirationDate!, - ), - ); - } -} diff --git a/lib/dashboard/missing_creentials/view/missing_credentials_page.dart b/lib/dashboard/missing_creentials/view/missing_credentials_page.dart index 11f226f67..cd3d4c789 100644 --- a/lib/dashboard/missing_creentials/view/missing_credentials_page.dart +++ b/lib/dashboard/missing_creentials/view/missing_credentials_page.dart @@ -62,7 +62,6 @@ class MissingCredentialsView extends StatelessWidget { Widget build(BuildContext context) { final l10n = context.l10n; - return BlocBuilder( builder: (context, state) { return BasePage( @@ -123,7 +122,7 @@ class MissingCredentialsView extends StatelessWidget { ), ); } - Navigator.pop(context); + Navigator.pop(context, true); }, text: l10n.getItNow, ), diff --git a/lib/dashboard/profile/cubit/profile_cubit.dart b/lib/dashboard/profile/cubit/profile_cubit.dart index 782fc61c3..c5764f385 100644 --- a/lib/dashboard/profile/cubit/profile_cubit.dart +++ b/lib/dashboard/profile/cubit/profile_cubit.dart @@ -237,7 +237,7 @@ class ProfileCubit extends Cubit { enterpriseWalletName: enterpriseWalletName, ); - case ProfileType.dutch: + case ProfileType.diipv2point1: final privateKey = await getPrivateKey( didKeyType: Parameters.didKeyTypeForDutch, profileCubit: this, @@ -249,7 +249,7 @@ class ProfileCubit extends Cubit { profileCubit: this, ); - profileModel = ProfileModel.dutch( + profileModel = ProfileModel.diipv2point1( polygonIdNetwork: polygonIdNetwork, walletType: walletType, walletProtectionType: walletProtectionType, @@ -259,7 +259,7 @@ class ProfileCubit extends Cubit { enterpriseWalletName: enterpriseWalletName, ); - case ProfileType.owfBaselineProfile: + case ProfileType.diipv3: final privateKey = await getPrivateKey( didKeyType: Parameters.didKeyTypeForOwfBaselineProfile, profileCubit: this, @@ -271,7 +271,7 @@ class ProfileCubit extends Cubit { profileCubit: this, ); - profileModel = ProfileModel.owfBaselineProfile( + profileModel = ProfileModel.diipv3( polygonIdNetwork: polygonIdNetwork, walletType: walletType, walletProtectionType: walletProtectionType, @@ -590,9 +590,9 @@ class ProfileCubit extends Cubit { .selfSovereignIdentityOptions.customOidc4vcProfile.clientSecret, ), ); - case ProfileType.dutch: + case ProfileType.diipv2point1: await update( - ProfileModel.dutch( + ProfileModel.diipv2point1( polygonIdNetwork: state.model.polygonIdNetwork, walletProtectionType: state.model.walletProtectionType, isDeveloperMode: state.model.isDeveloperMode, @@ -604,9 +604,9 @@ class ProfileCubit extends Cubit { .selfSovereignIdentityOptions.customOidc4vcProfile.clientSecret, ), ); - case ProfileType.owfBaselineProfile: + case ProfileType.diipv3: await update( - ProfileModel.owfBaselineProfile( + ProfileModel.diipv3( polygonIdNetwork: state.model.polygonIdNetwork, walletProtectionType: state.model.walletProtectionType, isDeveloperMode: state.model.isDeveloperMode, diff --git a/lib/dashboard/profile/models/profile.dart b/lib/dashboard/profile/models/profile.dart index b851d5588..51de1dc8c 100644 --- a/lib/dashboard/profile/models/profile.dart +++ b/lib/dashboard/profile/models/profile.dart @@ -146,7 +146,7 @@ class ProfileModel extends Equatable { ), ); - factory ProfileModel.dutch({ + factory ProfileModel.diipv2point1({ required PolygonIdNetwork polygonIdNetwork, required WalletType walletType, required WalletProtectionType walletProtectionType, @@ -161,7 +161,7 @@ class ProfileModel extends Equatable { walletType: walletType, walletProtectionType: walletProtectionType, isDeveloperMode: isDeveloperMode, - profileType: ProfileType.dutch, + profileType: ProfileType.diipv2point1, profileSetting: ProfileSetting( blockchainOptions: BlockchainOptions.initial(), generalOptions: GeneralOptions.empty(), @@ -215,7 +215,7 @@ class ProfileModel extends Equatable { ), ); - factory ProfileModel.owfBaselineProfile({ + factory ProfileModel.diipv3({ required PolygonIdNetwork polygonIdNetwork, required WalletType walletType, required WalletProtectionType walletProtectionType, @@ -230,7 +230,7 @@ class ProfileModel extends Equatable { walletType: walletType, walletProtectionType: walletProtectionType, isDeveloperMode: isDeveloperMode, - profileType: ProfileType.owfBaselineProfile, + profileType: ProfileType.diipv3, profileSetting: ProfileSetting( blockchainOptions: BlockchainOptions.initial(), generalOptions: GeneralOptions.empty(), diff --git a/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart b/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart index 7d1045ba4..4634e0b96 100644 --- a/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart +++ b/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart @@ -72,7 +72,10 @@ class QRCodeScanCubit extends Cubit { return super.close(); } - Future process({required String? scannedResponse}) async { + Future process({ + required String? scannedResponse, + required QRCodeScanCubit qrCodeScanCubit, + }) async { log.i('processing scanned qr code - $scannedResponse'); goBack(); await Future.delayed(const Duration(milliseconds: 1000)); @@ -114,7 +117,10 @@ class QRCodeScanCubit extends Cubit { /// enterprise final uri = Uri.parse(scannedResponse); emit(state.copyWith(qrScanStatus: QrScanStatus.goBack)); - await enterpriseCubit.requestTheConfiguration(uri); + await enterpriseCubit.requestTheConfiguration( + uri: uri, + qrCodeScanCubit: qrCodeScanCubit, + ); } else { final uri = Uri.parse(scannedResponse); await verify(uri: uri); @@ -214,6 +220,7 @@ class QRCodeScanCubit extends Cubit { required OpenIdConfiguration? openIdConfiguration, required String? issuer, required String? preAuthorizedCode, + required Uri uri, OIDC4VCType? oidcType, }) async { emit(state.loading()); @@ -221,8 +228,11 @@ class QRCodeScanCubit extends Cubit { late final dynamic data; + final customOidc4vcProfile = profileCubit.state.model.profileSetting + .selfSovereignIdentityOptions.customOidc4vcProfile; + try { - if (isOIDC4VCIUrl(state.uri!) && oidcType != null) { + if (isOIDC4VCIUrl(uri) && oidcType != null) { /// issuer side (oidc4VCI) if (issuer == null) { @@ -235,11 +245,10 @@ class QRCodeScanCubit extends Cubit { } await startOIDC4VCCredentialIssuance( - scannedResponse: state.uri.toString(), + scannedResponse: uri.toString(), isEBSIV3: oidcType == OIDC4VCType.EBSIV3, qrCodeScanCubit: qrCodeScanCubit, - oidc4vciDraftType: profileCubit.state.model.profileSetting - .selfSovereignIdentityOptions.customOidc4vcProfile.oidc4vciDraft, + oidc4vciDraftType: customOidc4vcProfile.oidc4vciDraft, credentialOfferJson: credentialOfferJson, openIdConfiguration: openIdConfiguration, issuer: issuer, @@ -248,13 +257,13 @@ class QRCodeScanCubit extends Cubit { return; } - if (isSIOPV2OROIDC4VPUrl(state.uri!)) { - await startSIOPV2OIDC4VPProcess(state.uri!); + if (isSIOPV2OROIDC4VPUrl(uri)) { + await startSIOPV2OIDC4VPProcess(uri); return; } /// did credential addition and presentation - final dynamic response = await client.get(state.uri!.toString()); + final dynamic response = await client.get(uri.toString()); data = response is String ? jsonDecode(response) : response; log.i('data - $data'); @@ -266,11 +275,11 @@ class QRCodeScanCubit extends Cubit { ); final PresentationDefinition? presentationDefinition = credentialManifest.presentationDefinition; + final isPresentable = await isVCPresentable( presentationDefinition: presentationDefinition, clientMetaData: null, - vcFormatType: profileCubit.state.model.profileSetting - .selfSovereignIdentityOptions.customOidc4vcProfile.vcFormatType, + vcFormatType: customOidc4vcProfile.vcFormatType, ); if (!isPresentable) { @@ -282,7 +291,30 @@ class QRCodeScanCubit extends Cubit { ), ), ); - return; + + missingCredentialCompleter = Completer(); + final value = await missingCredentialCompleter!.future; + missingCredentialCompleter = null; + + if (value) { + final isPresentable = await isVCPresentable( + presentationDefinition: presentationDefinition, + clientMetaData: null, + vcFormatType: customOidc4vcProfile.vcFormatType, + ); + + if (!isPresentable) { + throw ResponseMessage( + message: ResponseString + .RESPONSE_STRING_SOMETHING_WENT_WRONG_TRY_AGAIN_LATER, + ); + } + } else { + throw ResponseMessage( + message: ResponseString + .RESPONSE_STRING_SOMETHING_WENT_WRONG_TRY_AGAIN_LATER, + ); + } } } @@ -293,7 +325,7 @@ class QRCodeScanCubit extends Cubit { state.copyWith( qrScanStatus: QrScanStatus.success, route: CredentialsReceivePage.route( - uri: state.uri!, + uri: uri, preview: data as Map, issuer: approvedIssuer, ), @@ -316,14 +348,9 @@ class QRCodeScanCubit extends Cubit { final isPresentable = await isCredentialPresentable( credentialSubjectType: credentialSubjectType, - vcFormatType: profileCubit - .state - .model - .profileSetting - .selfSovereignIdentityOptions - .customOidc4vcProfile - .vcFormatType, + vcFormatType: customOidc4vcProfile.vcFormatType, ); + if (!isPresentable) { emit( state.copyWith( @@ -331,49 +358,70 @@ class QRCodeScanCubit extends Cubit { route: MissingCredentialsPage.route(query: query), ), ); - return; - } - } - queryByExampleCubit.setQueryByExampleCubit(query); + missingCredentialCompleter = Completer(); + final value = await missingCredentialCompleter!.future; + missingCredentialCompleter = null; - log.i(data['query']); - if (data['query'].first['type'] == 'DIDAuth') { - log.i('DIDAuth'); - await scanCubit.askPermissionDIDAuthCHAPI( - keyId: SecureStorageKeys.ssiKey, - done: (done) { - log.i('done'); - }, - uri: state.uri!, - challenge: data['challenge'] as String, - domain: data['domain'] as String, - ); - emit(state.copyWith(qrScanStatus: QrScanStatus.idle)); - } else if (data['query'].first['type'] == 'QueryByExample') { - log.i('QueryByExample'); - emit( - state.copyWith( - qrScanStatus: QrScanStatus.success, - route: QueryByExamplePresentPage.route( - uri: state.uri!, - preview: data as Map, - issuer: approvedIssuer, + if (value) { + final isPresentable = await isCredentialPresentable( + credentialSubjectType: credentialSubjectType, + vcFormatType: customOidc4vcProfile.vcFormatType, + ); + if (!isPresentable) { + throw ResponseMessage( + message: ResponseString + .RESPONSE_STRING_SOMETHING_WENT_WRONG_TRY_AGAIN_LATER, + ); + } + } else { + throw ResponseMessage( + message: ResponseString + .RESPONSE_STRING_SOMETHING_WENT_WRONG_TRY_AGAIN_LATER, + ); + } + } + + queryByExampleCubit.setQueryByExampleCubit(query); + + log.i(data['query']); + if (data['query'].first['type'] == 'DIDAuth') { + log.i('DIDAuth'); + await scanCubit.askPermissionDIDAuthCHAPI( + keyId: SecureStorageKeys.ssiKey, + done: (done) { + log.i('done'); + }, + uri: uri, + challenge: data['challenge'] as String, + domain: data['domain'] as String, + ); + emit(state.copyWith(qrScanStatus: QrScanStatus.idle)); + } else if (data['query'].first['type'] == 'QueryByExample') { + log.i('QueryByExample'); + emit( + state.copyWith( + qrScanStatus: QrScanStatus.success, + route: QueryByExamplePresentPage.route( + uri: uri, + preview: data as Map, + issuer: approvedIssuer, + ), ), - ), - ); - } else { - throw ResponseMessage( - message: - ResponseString.RESPONSE_STRING_UNIMPLEMENTED_QUERY_TYPE, - ); + ); + } else { + throw ResponseMessage( + message: + ResponseString.RESPONSE_STRING_UNIMPLEMENTED_QUERY_TYPE, + ); + } } } else { emit( state.copyWith( qrScanStatus: QrScanStatus.success, route: QueryByExamplePresentPage.route( - uri: state.uri!, + uri: uri, preview: data as Map, issuer: approvedIssuer, ), @@ -386,7 +434,7 @@ class QRCodeScanCubit extends Cubit { state.copyWith( qrScanStatus: QrScanStatus.success, route: CredentialsReceivePage.route( - uri: state.uri!, + uri: uri, preview: data as Map, issuer: approvedIssuer, ), @@ -744,7 +792,10 @@ class QRCodeScanCubit extends Cubit { /// responseType == 'id_token vp_token' => verifier side (oidc4vp) /// or (oidc4vp and siopv2) - await launchOIDC4VPAndSIOPV2Flow(keys); + await launchOIDC4VPAndSIOPV2Flow( + keys: keys, + uri: state.uri!, + ); } else { throw ResponseMessage( data: { @@ -758,6 +809,7 @@ class QRCodeScanCubit extends Cubit { Future startOIDC4VCDeferedCredentialIssuance({ required CredentialModel credentialModel, + required QRCodeScanCubit qrCodeScanCubit, }) async { try { emit(state.loading()); @@ -797,6 +849,7 @@ class QRCodeScanCubit extends Cubit { jwtDecode: jwtDecode, blockchainType: walletCubit.state.currentAccount!.blockchainType, oidc4vciDraftType: customOidc4vcProfile.oidc4vciDraft, + qrCodeScanCubit: qrCodeScanCubit, ); } catch (e) { emitError(e); @@ -857,7 +910,12 @@ class QRCodeScanCubit extends Cubit { ); } - Future launchOIDC4VPAndSIOPV2Flow(List keys) async { + Completer? missingCredentialCompleter; + + Future launchOIDC4VPAndSIOPV2Flow({ + required List keys, + required Uri uri, + }) async { if (!keys.contains('presentation_definition') && !keys.contains('presentation_definition_uri')) { throw ResponseMessage( @@ -871,10 +929,7 @@ class QRCodeScanCubit extends Cubit { } final Map? presentationDefinitionData = - await getPresentationDefinition( - client: client, - uri: state.uri!, - ); + await getPresentationDefinition(client: client, uri: uri); if (presentationDefinitionData == null) { throw ResponseMessage( @@ -913,10 +968,7 @@ class QRCodeScanCubit extends Cubit { Map? clientMetaData; if (presentationDefinition.format == null) { - clientMetaData = await getClientMetada( - client: client, - uri: state.uri!, - ); + clientMetaData = await getClientMetada(client: client, uri: uri); if (clientMetaData != null) { if (!clientMetaData.containsKey('vp_formats')) { @@ -964,7 +1016,31 @@ class QRCodeScanCubit extends Cubit { ), ), ); - return; + + missingCredentialCompleter = Completer(); + final value = await missingCredentialCompleter!.future; + missingCredentialCompleter = null; + + if (value) { + final isPresentable = await isVCPresentable( + presentationDefinition: presentationDefinition, + clientMetaData: clientMetaData, + vcFormatType: profileCubit.state.model.profileSetting + .selfSovereignIdentityOptions.customOidc4vcProfile.vcFormatType, + ); + + if (!isPresentable) { + throw ResponseMessage( + message: ResponseString + .RESPONSE_STRING_SOMETHING_WENT_WRONG_TRY_AGAIN_LATER, + ); + } + } else { + throw ResponseMessage( + message: ResponseString + .RESPONSE_STRING_SOMETHING_WENT_WRONG_TRY_AGAIN_LATER, + ); + } } final CredentialModel credentialPreview = CredentialModel( @@ -985,13 +1061,13 @@ class QRCodeScanCubit extends Cubit { credentialManifest: credentialManifest, ); - final host = await getHost(uri: state.uri!, client: client); + final host = await getHost(uri: uri, client: client); emit( state.copyWith( qrScanStatus: QrScanStatus.success, route: CredentialManifestOfferPickPage.route( - uri: state.uri!, + uri: uri, credential: credentialPreview, issuer: Issuer.emptyIssuer(host), inputDescriptorIndex: 0, @@ -1067,6 +1143,9 @@ class QRCodeScanCubit extends Cubit { header: header, jwtDecode: jwtDecode, ); + } else if (clientIdScheme == 'redirect_uri') { + /// no need to verify + return emit(state.acceptHost()); } final VerificationType isVerified = await verifyEncodedData( @@ -1183,6 +1262,7 @@ class QRCodeScanCubit extends Cubit { required String? preAuthorizedCode, required String issuer, required dynamic credentialOfferJson, + required QRCodeScanCubit qrCodeScanCubit, }) async { try { final ( @@ -1214,6 +1294,7 @@ class QRCodeScanCubit extends Cubit { clientSecret: clientSecret, oAuthClientAttestation: oAuthClientAttestation, oAuthClientAttestationPop: oAuthClientAttestationPop, + qrCodeScanCubit: qrCodeScanCubit, ); } else { emit(state.loading()); @@ -1261,6 +1342,7 @@ class QRCodeScanCubit extends Cubit { required String? authorization, required String? clientId, required String? clientSecret, + required QRCodeScanCubit qrCodeScanCubit, String? oAuthClientAttestation, String? oAuthClientAttestationPop, }) async { @@ -1418,6 +1500,7 @@ class QRCodeScanCubit extends Cubit { encodedCredentialOrFutureTokens: encodedCredentialOrFutureTokens, format: format, openIdConfiguration: openIdConfiguration, + qrCodeScanCubit: qrCodeScanCubit, ); } else { throw ResponseMessage( @@ -1469,6 +1552,7 @@ class QRCodeScanCubit extends Cubit { Future authorizedFlowCompletion({ required Map statePayload, required String codeForAuthorisedFlow, + required QRCodeScanCubit qrCodeScanCubit, }) async { try { final containsAllRequiredKey = statePayload.containsKey('credentials') && @@ -1510,6 +1594,7 @@ class QRCodeScanCubit extends Cubit { clientSecret: clientSecret, oAuthClientAttestation: oAuthClientAttestation, oAuthClientAttestationPop: oAuthClientAttestationPop, + qrCodeScanCubit: qrCodeScanCubit, ); } catch (e) { emitError(e); diff --git a/lib/dashboard/qr_code/qr_code_scan/view/qr_code_scan_page.dart b/lib/dashboard/qr_code/qr_code_scan/view/qr_code_scan_page.dart index 7dac2636c..f57b3b1c2 100644 --- a/lib/dashboard/qr_code/qr_code_scan/view/qr_code_scan_page.dart +++ b/lib/dashboard/qr_code/qr_code_scan/view/qr_code_scan_page.dart @@ -82,9 +82,10 @@ class _QrCodeScanPageState extends State { if (isScanned) return; isScanned = true; - await context - .read() - .process(scannedResponse: barcodes.first.rawValue); + await context.read().process( + scannedResponse: barcodes.first.rawValue, + qrCodeScanCubit: context.read(), + ); } }, initialCameraLensDirection: _cameraLensDirection, diff --git a/lib/dashboard/self_issued_credential_button/cubit/self_issued_credential_button_cubit.dart b/lib/dashboard/self_issued_credential_button/cubit/self_issued_credential_button_cubit.dart index 2e4f758ba..1d16d092c 100644 --- a/lib/dashboard/self_issued_credential_button/cubit/self_issued_credential_button_cubit.dart +++ b/lib/dashboard/self_issued_credential_button/cubit/self_issued_credential_button_cubit.dart @@ -22,12 +22,14 @@ class SelfIssuedCredentialCubit extends Cubit { required this.profileCubit, required this.walletCubit, required this.jwtDecode, + required this.qrCodeScanCubit, }) : super(const SelfIssuedCredentialButtonState()); final CredentialsCubit credentialsCubit; final ProfileCubit profileCubit; final WalletCubit walletCubit; final JWTDecode jwtDecode; + final QRCodeScanCubit qrCodeScanCubit; Future createSelfIssuedCredential({ required SelfIssuedCredentialDataModel selfIssuedCredentialDataModel, @@ -150,6 +152,7 @@ class SelfIssuedCredentialCubit extends Cubit { await credentialsCubit.insertCredential( credential: credentialModel, blockchainType: walletCubit.state.currentAccount!.blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); emit( state.success( diff --git a/lib/enterprise/cubit/enterprise_cubit.dart b/lib/enterprise/cubit/enterprise_cubit.dart index 9519fc0bc..402a7b669 100644 --- a/lib/enterprise/cubit/enterprise_cubit.dart +++ b/lib/enterprise/cubit/enterprise_cubit.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:altme/app/app.dart'; import 'package:altme/credentials/credentials.dart'; -import 'package:altme/dashboard/profile/profile.dart'; +import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/oidc4vc/oidc4vc.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -25,7 +25,10 @@ class EnterpriseCubit extends Cubit { final ProfileCubit profileCubit; final CredentialsCubit credentialsCubit; - Future requestTheConfiguration(Uri uri) async { + Future requestTheConfiguration({ + required Uri uri, + required QRCodeScanCubit qrCodeScanCubit, + }) async { try { emit(state.loading()); @@ -96,6 +99,7 @@ class EnterpriseCubit extends Cubit { await credentialsCubit.addWalletCredential( blockchainType: credentialsCubit.walletCubit.state.currentAccount?.blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); emit( diff --git a/lib/enterprise/widget/wallet_revoked_dialog.dart b/lib/enterprise/widget/wallet_revoked_dialog.dart index 7f735a1af..781289dd8 100644 --- a/lib/enterprise/widget/wallet_revoked_dialog.dart +++ b/lib/enterprise/widget/wallet_revoked_dialog.dart @@ -1,8 +1,11 @@ +import 'dart:io'; + import 'package:altme/app/app.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; class WalletRevokedDialog extends StatelessWidget { const WalletRevokedDialog({super.key}); @@ -45,7 +48,13 @@ class WalletRevokedDialog extends StatelessWidget { ), TextButton( onPressed: () { - Navigator.of(context).pop(); + if (isAndroid) { + SystemNavigator.pop(); + } else { + Future.delayed(const Duration(milliseconds: 500), () { + exit(0); + }); + } }, child: Text( l10n.close.toUpperCase(), diff --git a/lib/l10n/arb/app_ca.arb b/lib/l10n/arb/app_ca.arb index 1b63f3e2d..ff2d1153d 100644 --- a/lib/l10n/arb/app_ca.arb +++ b/lib/l10n/arb/app_ca.arb @@ -570,7 +570,6 @@ "otherCredentialDiscoverSubtitle": "Altres tipus de targetes que pots afegir", "showMore": "...Mostrar més", "showLess": "Mostrar menys...", - "youHaveReceivedARewardOf": "Has rebut un premi de", "gotIt": "Entesos", "transactionErrorBalanceTooLow": "Una operació ha intentat gastar més tokens del que té el contracte", "transactionErrorCannotPayStorageFee": "La tarifa d’emmagatzematge és superior al saldo del contracte", @@ -597,9 +596,6 @@ "twitterWhyGetThisCard": "Aquesta targeta és una prova que ets el propietari del teu compte de Twitter. Utilitza-la per demostrar la propietat del teu compte de Twitter sempre que ho necessitis.", "twitterExpirationDate": "Aquesta targeta romandrà activa durant 1 ANY.", "twitterDummyDesc": "Demostra la propietat dels teus comptes de Twitter", - "linkedinCardHowToGetIt": "Pots demanar aquesta targeta seguint la verificació KYC d’Altme. Només s’accedirà a la informació relacionada amb el teu nom, cognoms, nacionalitat i any de naixement des del teu perfil de LinkedIn.", - "linkedinCardWhyGetThisCard": "Aquesta targeta és una prova de la teva identitat per al teu perfil de LinkedIn. Des d’aquesta targeta, pots exportar un codi QR i mostrar-lo a la capçalera del teu compte de LinkedIn. En escanejar el codi QR amb la cartera Altme, qualsevol persona podrà verificar que la teva identitat coincideix amb l’URL del teu perfil de LinkedIn, i també podrà accedir a 2 dades més: la teva nacionalitat i el teu any de naixement.", - "linkedinCardExpirationDate": "Aquesta targeta romandrà activa i reutilitzable durant 1 ANY.", "tezotopiaMembershipHowToGetIt": "Has de presentar una prova que tens més de 13 anys i una prova del teu correu electrònic.", "over18WhyGetThisCard": "Algunes aplicacions/llocs web de Web 3 poden requerir aquesta prova per accedir al seu servei o obtenir avantatges: Targeta de membre, de fidelitat, premis, etc.", "over18ExpirationDate": "Aquesta targeta romandrà activa i reutilitzable durant 1 ANY.", @@ -635,9 +631,6 @@ "defiComplianceWhyGetThisCard": "Obtén una prova verificable de conformitat amb KYC/AML, sol·licitada per protocols DeFi compatibles i dApps de Web3. Una vegada obtinguda, pots encunyar un NFT protector de privadesa i no transferible per a la verificació a la cadena de blocs sense mostrar dades personals.", "defiComplianceExpirationDate": "Aquestes credencials romanen actives 3 mesos. Per renovació cal una comprovació de conformitat senzilla, sense nou KYC.", "defiComplianceHowToGetIt": "És fàcil! Fes una verificació KYC única a la cartera Altme (desenvolupada per ID360) i sol·demana la teva credencial de conformitat DeFi.", - "rewardDialogTitle": "Ben fet 🥳", - "rewardDialogDescPart1": "Acabes de rebre", - "rewardDialogDescPart2": "al teu compte", "origin": "Origen", "nftTooBigToLoad": "NFT massa gran per carregar", "seeTransaction": "Veure transacció", @@ -769,16 +762,8 @@ "softwareLicenses": "Llicències de software", "notAValidWalletAddress": "Adreça de cartera invàlida.", "otherAccount": "Altre compte", - "thereIsNoAccountInYourWallet": "No hi ha comptes a la teva cartera", - "exportToLinkedIn": "Exportar a LinkedIn", - "addLinkedInInfo": "Afegir info de LinkedIn", - "whatsYourLinkedinProfileUrl": "Quina és la URL de perfil del teu LinkedIn?", - "invalidUrlError": "Indica una URL de LinkedIn vàlida", - "linkedInBannerSuccessfullyExported": "El teu bàner de LinkedIn s’ha exportat amb èxit.", - "credentialSuccessfullyExported": "La teva credencial s’ha exportat correctament.", - "linkedInBanner": "Bàner de LinkedIn", - "linkedInProfile": "Perfil de LinkedIn", - "checkLinkedinProfile": "Verifica un perfil de LinkedIn", + "thereIsNoAccountInYourWallet": "No hi ha comptes a la teva cartera", + "credentialSuccessfullyExported": "La teva credencial s’ha exportat correctament.", "scanAndDisplay": "Escanejar i mostrar", "whatsNew": "Novetats", "okGotIt": "Entesos!", @@ -941,11 +926,8 @@ "theRequestIsRejected": "S’ha refusat la sol·licitud.", "userPinIsIncorrect": "PIN d’usuari incorrecte", "security_level": "Nivell de seguretat", - "oidc4vc_settings": "Configuració d’OIDC4VC", "userPinTitle": "Dígits PIN de l’usuari: codi_preautoritzat Flux", "userPinSubtitle": "Per defecte: 6 DÍGITS\nPermetre gestionar codi PIN de 4 dígits", - "securityLevelTitle": "Nivell de cartera", - "securityLevelSubTitle": "Per defecte: Permissiu\nCanvia a “Estricte” per reforçar els controls a emissors i verificadors", "responseTypeNotSupported": "Tipus de resposta no compatible", "invalidRequest": "Sol·licitud no vàlida", "subjectSyntaxTypeNotSupported": "Sintaxi del subjecte no compatible.", @@ -967,14 +949,6 @@ "selectOneOfTheDid": "Selecciona un dels DID", "subjectSyntaxType": "Tipus de sintaxis del subjecte", "enableToUseTheJWKThumprintOfTheKey": "Per defecte: DID\nPermet utilitzar l’empremta digital JWK de la clau", - "cryptographicHolderBinding": "Enllaç criptogràfic del titular", - "cryptographicHolderBindingSubtitle": "Per defecte: activat\nDesactivar l’autorització de credencials de portador per tiquets poc fiables.", - "scopeParameters": "Paràmetres d’àmbit", - "scopeParametersSubtitle": "Per defecte: desactivat\nActivar per forçar la cartera a utilitzar l’àmbit en lloc dels detalls_d’autorització.", - "clientAuthenticationMethods": "Mètodes d’autenticació del client", - "clientAuthenticationMethodsSubtitle": "Per defecte: Identificador del client com a DID o JWK\nSelecciona altres mètodes d’autenticació si és necessari.", - "vcFormatType": "Format VC", - "vcFormatTypeSubtitle": "Per defecte: ldp_vc\nSelecciona un dels formats VC.", "theServiceIsNotAvailable": "Servei no disponible", "issuerDID": "Emissor DID", "subjectDID": "Subjecte DID", @@ -992,9 +966,6 @@ "clientSecret": "Client secret", "walletProfiles": "Perfils de la cartera", "walletProfilesDescription": "Escull un perfil SSI o personalitza el teu", - "profileCustom": "Personalitzar", - "profileEbsiV3": "Infraestructura de serveis blockchain europea", - "decentralizedIdentityInteropProfile": "Perfil d’interop d’identitat descentralizada", "protectYourWallet": "Protegeix la teva cartera", "protectYourWalletMessage": "Utilitza l’empremta digital, la cara o el PIN del dispositiu per protegir i desbloquejar la teva cartera. Dades xifrades i segures en aquest dispositiu.", "pinUnlock": "Desbloqueig PIN", @@ -1014,8 +985,7 @@ "enterTheSecurityCode": "Indica el codi de seguretat", "yourEmail": "El teu correu electrònic", "publicKeyOfWalletInstance": "Clau pública de la instància de la cartera", - "walletInstanceKey": "Clau d’instància de la cartera", - "protocoleStandardRelease": "Llançament estàndard del protocol", + "walletInstanceKey": "Clau d’instància de la cartera", "organizationProfile": "Perfil de l’organització", "profileName": "Nom del perfil", "companyName": "Nom de l’empresa", @@ -1028,40 +998,24 @@ "continueString": "Continuar", "walletProvider": "Proveïdor de cartera", "clientTypeSubtitle" : "Predeterminat: DID\nDesplaci per canviar el tipus de client", - "proofHeader" : "Capçalera de prova de possessió", - "proofHeaderSubtitle" : "Predeterminat: kid\nCanviar si es necessita JWK a la capçalera", - "theLdpFormatIsNotSupportedByThisDIDMethod": "El format LDP no és compatible amb aquest mètode DID", "switchOffCryptoHolderBindingForThatDIDMethod": "Desactivar la vinculació del titular (o posseïdor) de criptoactius per a aquest mètode DID", "thisTypeProofCannotBeUsedWithThisVCFormat": "Aquest tipus de prova no es pot fer servir amb aquest format de CV", - "enterprise" : "Organització/Empresa", - "oWFBaselineProfile": "Perfil de Línia Base d'OWF", - "defaultProfile" : "Predeterminat", "blockchainCardsDiscoverTitle": "Obtenir prova de propietat de compte cripto", "blockchainCardsDiscoverSubtitle" : "Obtenir prova de propietat de compte de criptoactius", "successfullyAddedEnterpriseAccount": "Compte d'Organització/Empresa afegida amb èxit!", "successfullyUpdatedEnterpriseAccount" : "Compte d'Organització/Empresa actualitzada amb èxit!", "languageSelectorTitle": "catalan", - "proofType": "Tipus de prova OIDC4VCI", - "proofTypeSubtitle": "Predeterminat: jwt\nSeleccioneu un dels tipus de prova.", "thisWalleIsAlreadyConfigured": "Aquesta cartera ja està configurada", "walletSettings": "Configuració de la cartera", "walletSettingsDescription": "Trieu el vostre idioma", "phoneLanguage": "Idioma del telèfon", - "pushAuthorizationRequestTitle": "Sol·licitud d'autorització Push (PAR)", - "pushAuthorizationRequestSubTitle": "Predeterminat: false\nHabiliteu per assegurar el flux del codi d'autorització", "cardIsValid": "La targeta és vàlida", "cardIsExpired": "La targeta ha caducat", "signatureIsInvalid": "La signatura no és vàlida", "statusIsInvalid": "L'estat no és vàlid", "statuslListSignatureFailed": "Error en la signatura de la llista d'estats", - "walletMetadataForIssuers": "Metadades de la cartera per a emissors", - "walletMetadataForVerifiers": "Metadades de la cartera per a verificadors", - "statusListCachingTitle": "Emmagatzematge en memòria cau de la llista d'estat", - "statusListCachingSubTitle": "Predeterminat: Activat\nApagueu per recarregar la llista d'estats quan sigui necessari", "statusList": "Llista d'estats", "statusListIndex": "Índex de la llista d'estats", "theWalletIsSuspended": "La cartera està suspesa.", - "clientTypeTitle": "Esquema Client_id de la cartera", - "confidentialClient": "Client confidencial", "jwkThumbprintP256Key": "Empremta digital JWK P-256" } \ No newline at end of file diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index a2d644bea..126f92914 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -567,7 +567,6 @@ "otherCredentialDiscoverSubtitle": "Other types of cards you can add", "showMore": "...Show more", "showLess": "Show less...", - "youHaveReceivedARewardOf": "You have received a reward of", "gotIt": "Got it", "transactionErrorBalanceTooLow": "An operation tried to spend more tokens than the contract has", "transactionErrorCannotPayStorageFee": "The storage fee is higher than the contract balance", @@ -594,9 +593,6 @@ "twitterWhyGetThisCard": "This card is a proof that you own your twitter account. Use it to prove your twitter account ownership whenever you need.", "twitterExpirationDate": "This card will be active for 1 year.", "twitterDummyDesc": "Prove your twitter account ownership", - "linkedinCardHowToGetIt": "You can claim this card by following Talao KYC check. Only information related to your first name, last name, nationality and year of birth will be accessible from your LinkedIn profile.", - "linkedinCardWhyGetThisCard": "This card is a proof of your identity for your LinkedIn profile. From this card, you can export a QR code and display it in the banner on your LinkedIn account. By scanning the QR code with his Talao wallet, anyone will be able to verify that your identity matches the URL of your LinkedIn profile, and will also be able to access 2 additional information: your nationality and your year of birth.", - "linkedinCardExpirationDate": "This card will remain active and reusable for 1 YEAR.", "tezotopiaMembershipHowToGetIt": "You need to present a proof that you are over 13 YO and a proof of your email.", "over18WhyGetThisCard": "This proof may be required by some Web 3 Apps / Websites to access their service or claim benefits : Membership card, Loyalty card, Rewards, etc.", "over18ExpirationDate": "This card will remain active and reusable for 1 YEAR.", @@ -631,10 +627,7 @@ "ageRangeHowToGetIt": "You can claim this card by following Talao’s KYC check.", "defiComplianceWhyGetThisCard": "Obtain verifiable proof of KYC/AML compliance, requested by compliant DeFi protocols and Web3 dApps. Once obtained, you can mint a privacy-preserving, non-transferable NFT for on-chain verification without revealing personal data.", "defiComplianceExpirationDate": "This credential remains active for 3 months. Renewal requires a straightforward compliance check, without new KYC.", - "defiComplianceHowToGetIt": "It's easy! Complete a one-time KYC check in Talao wallet (powered by ID360) and request your DeFi compliance credential.", - "rewardDialogTitle": "Well done 🥳", - "rewardDialogDescPart1": "You just received", - "rewardDialogDescPart2": "on your account", + "defiComplianceHowToGetIt": "It's easy! Complete a one-time KYC check in Altme wallet (powered by ID360) and request your DeFi compliance credential.", "origin": "Origin", "nftTooBigToLoad": "NFT loading", "seeTransaction": "See transaction", @@ -766,16 +759,8 @@ "softwareLicenses": "Software Licenses", "notAValidWalletAddress": "Not a valid wallet address!", "otherAccount": "Other account", - "thereIsNoAccountInYourWallet": "There is no account in your wallet", - "exportToLinkedIn": "Export To LinkedIn", - "addLinkedInInfo": "Add LinkedIn Info", - "whatsYourLinkedinProfileUrl": "What's your LinkedIn profile URL?", - "invalidUrlError": "Please enter a valid LinkedIn URL", - "linkedInBannerSuccessfullyExported": "Your LinkedIn banner has been successfully exported.", - "credentialSuccessfullyExported": "Your credential has been successfully exported.", - "linkedInBanner": "Linkedin Banner", - "linkedInProfile": "Linkedin Profile", - "checkLinkedinProfile": "Check a Linkedin Profile", + "thereIsNoAccountInYourWallet": "There is no account in your wallet", + "credentialSuccessfullyExported": "Your credential has been successfully exported.", "scanAndDisplay": "Scan and Display", "whatsNew": "What's new", "okGotIt": "OK, GOT IT!", @@ -935,12 +920,9 @@ "highSecurity": "High Security", "theRequestIsRejected": "The request is rejected.", "userPinIsIncorrect": "User PIN is incorrect", - "security_level": "Security Level", - "oidc4vc_settings": "OIDC4VC Settings", + "security_level": "Security Level", "userPinTitle": "User PIN Digits pre-authorized_code Flow", "userPinSubtitle": "Default: 6 digits\nEnable to manage 4 digits PIN code", - "securityLevelTitle": "Wallet Level", - "securityLevelSubTitle": "Default: Permissive\nSet to Strict to strengthen controls for issuers and verifiers", "responseTypeNotSupported": "The response type is not supported", "invalidRequest": "The request is invalid", "subjectSyntaxTypeNotSupported": "The subject syntax type is not supported.", @@ -959,15 +941,7 @@ "keyDecentralizedIDP256": "did:key P-256", "jwkDecentralizedIDP256": "JWK Thumbprint P-256", "defaultDid": "Default DID", - "selectOneOfTheDid": "Select one of the DIDs", - "cryptographicHolderBinding": "Cryptographic Holder Binding", - "cryptographicHolderBindingSubtitle": "Default : On\nDisable cryptographic binding for claim based binding credentials.", - "scopeParameters": "Scope Parameters", - "scopeParametersSubtitle": "Default : Off\nEnable to force wallet to use scope instead of authorization_details.", - "clientAuthenticationMethods": "Client Authentication Methods", - "clientAuthenticationMethodsSubtitle": "Default: Client id as DID or JWK\nSelect to other authentication methods if needed.", - "vcFormatType": "VC Format", - "vcFormatTypeSubtitle": "Default: ldp_vc\nSelect one of the VC formats.", + "selectOneOfTheDid": "Select one of the DIDs", "theServiceIsNotAvailable": "The service is not available", "issuerDID": "Issuer DID", "subjectDID": "Subject DID", @@ -984,9 +958,6 @@ "clientSecret": "Client Secret", "walletProfiles": "Wallet Profiles", "walletProfilesDescription": "Choose your SSI profile or customize your own", - "profileCustom": "Custom", - "profileEbsiV3": "European Blockchain Services Infrastructure", - "decentralizedIdentityInteropProfile": "Decentralized Identity Interop Profile (DIIP v2.1)", "protectYourWallet": "Protect your wallet", "protectYourWalletMessage": "Use your fingerprint, face, or device PIN to secure and unlock your wallet. Your data is securely encrypted on this device.", "pinUnlock": "PIN unlock", @@ -1005,8 +976,7 @@ "enterTheSecurityCode": "Enter the security code", "yourEmail": "Your email", "publicKeyOfWalletInstance": "Public Key of Wallet Instance", - "walletInstanceKey": "Wallet Instance Key", - "protocoleStandardRelease": "Protocole standard release", + "walletInstanceKey": "Wallet Instance Key", "organizationProfile": "Organization Profile", "profileName": "Profile Name", "companyName": "Company Name", @@ -1019,19 +989,11 @@ "continueString": "Continue", "walletProvider": "Wallet Provider", "clientTypeSubtitle": "Default: DID\nSwitch to change the client type", - "proofHeader": "Proof of Possession Header", - "proofHeaderSubtitle": "Default: kid\nSwitch if jwk is needed in header.", - "theLdpFormatIsNotSupportedByThisDIDMethod": "The ldp_format is not supported by this DID method.", "thisTypeProofCannotBeUsedWithThisVCFormat": "This type proof cannot be used with this VC Format.", - "enterprise": "Enterprise", - "oWFBaselineProfile": "OWF Baseline Profile", - "defaultProfile":"Default", "blockchainCardsDiscoverTitle": "Get a proof of crypto account ownership", "blockchainCardsDiscoverSubtitle": "Get a proof of crypto account ownership.", "successfullyAddedEnterpriseAccount": "Successfully added enterprise account!", "successfullyUpdatedEnterpriseAccount": "Successfully updated enterprise account!", - "proofType": "OIDC4VCI Proof Type", - "proofTypeSubtitle": "Default: jwt\nSelect one of the proof type.", "thisWalleIsAlreadyConfigured": "This wallet is already configured", "walletSettings": "Wallet Settings", "walletSettingsDescription": "Choose your language and theme", @@ -1040,23 +1002,15 @@ "spanish": "Español", "catalan": "Català", "english": "English", - "phoneLanguage": "Phone language", - "pushAuthorizationRequestTitle": "Push Authorization Request (PAR)", - "pushAuthorizationRequestSubTitle": "Default: false\nEnable to secure the authorization code flow", + "phoneLanguage": "Phone language", "cardIsValid": "Card is valid", "cardIsExpired": "Card is expired", "signatureIsInvalid": "Signature is invalid", "statusIsInvalid": "Status is invalid", - "statuslListSignatureFailed": "Status list signature failed", - "walletMetadataForIssuers": "Wallet metadata for issuers", - "walletMetadataForVerifiers": "Wallet metadata for verifiers", - "statusListCachingTitle": "StatusList caching", - "statusListCachingSubTitle": "Default: On\nSwitch off to reload StatusList when needed", + "statuslListSignatureFailed": "Status list signature failed", "statusList": "Status list", "statusListIndex": "Status list index", - "theWalletIsSuspended": "The wallet is suspended.", - "clientTypeTitle": "Wallet Client_id Scheme", - "confidentialClient": "Confidential Client", + "theWalletIsSuspended": "The wallet is suspended.", "jwkThumbprintP256Key": "did:jwk P-256", "walletBlockedPopupTitle": "Blockerd 10 minutes", "walletBlockedPopupDescription": "Too many failed attempts, your wallet is blocked for your security.\nYou can reset your wallet in order to use servives again.", @@ -1083,5 +1037,4 @@ "darkThemeText": "Dark Theme", "lightThemeText": "Light Theme", "systemThemeText": "Phone Theme" - } diff --git a/lib/l10n/arb/app_es.arb b/lib/l10n/arb/app_es.arb index 658240cfd..750e82e05 100644 --- a/lib/l10n/arb/app_es.arb +++ b/lib/l10n/arb/app_es.arb @@ -570,7 +570,6 @@ "otherCredentialDiscoverSubtitle": "Otros tipos de tarjetas que puede añadir", "showMore": "... Mostrar más", "showLess": "Mostrar menos...", - "youHaveReceivedARewardOf": "Ha recibido una recompensa de", "gotIt": "De acuerdo", "transactionErrorBalanceTooLow": "Una operación ha intentado gastar más tokens que los del contrato", "transactionErrorCannotPayStorageFee": "El coste de almacenamiento supera el saldo del contrato", @@ -597,9 +596,6 @@ "twitterWhyGetThisCard": "La tarjeta demuestra que es titular de su cuenta de Twitter. Úsela siempre que tenga que demostrar que es titular de su cuenta de Twitter.", "twitterExpirationDate": "Esta tarjeta seguirá activa durante 1 año.", "twitterDummyDesc": "Demuestre que es titular de su cuenta de Twitter.", - "linkedinCardHowToGetIt": "Puede solicitar esta tarjeta tras la verificación KYC de Altme. En su perfil de LinkedIn solo se podrá acceder a información sobre su nombre y apellidos, nacionalidad y año de nacimiento.", - "linkedinCardWhyGetThisCard": "La tarjeta demuestra su identidad para su perfil de LinkedIn. Permite exportar un código QR que mostrar en el banner de su cuenta de LinkedIn. Al escanear el código QR con su cartera de Altme, cualquier persona podrá verificar que su identidad coincide con la URL de su perfil de LinkedIn y consultar su nacionalidad y año de nacimiento.", - "linkedinCardExpirationDate": "Esta tarjeta seguirá activa y reutilizable durante 1 AÑO.", "tezotopiaMembershipHowToGetIt": "Debe presentar una prueba de que es mayor de 13 años y otra para su email.", "over18WhyGetThisCard": "Prueba que pueden requerir algunas aplicaciones/sitios web 3.0 para acceder a su servicio o sus ventajas: Tarjeta de afiliación o fidelización, recompensas, etc.", "over18ExpirationDate": "Esta tarjeta seguirá activa y reutilizable durante 1 AÑO.", @@ -635,9 +631,6 @@ "defiComplianceWhyGetThisCard": "Obtenga pruebas verificables de cumplimiento de KYC/AML para protocolos DeFi y dApps Web 3 conformes. Tras su obtención, puede emitir un NFT intransferible y que proteja la privacidad para verificación en cadena sin revelar datos personales.", "defiComplianceExpirationDate": "Esta credencial sigue activa durante 3 meses. La renovación requiere una verificación de cumplimiento sencilla, sin un nuevo KYC.", "defiComplianceHowToGetIt": "¡Es fácil! Haga una verificación KYC única en la cartera de Altme (ID360) y solicite su credencial de cumplimiento DeFi.", - "rewardDialogTitle": "¡Fantástico 🥳!", - "rewardDialogDescPart1": "Acaba de recibir", - "rewardDialogDescPart2": "en su cuenta", "origin": "Origen", "nftTooBigToLoad": "El NFT es demasiado grande para cargarse", "seeTransaction": "Ver transacción", @@ -769,16 +762,8 @@ "softwareLicenses": "Licencias de software", "notAValidWalletAddress": "¡No es una dirección de cartera válida!", "otherAccount": "Otra cuenta", - "thereIsNoAccountInYourWallet": "No hay ninguna cuenta en su cartera", - "exportToLinkedIn": "Exportar a LinkedIn", - "addLinkedInInfo": "Añadir información de LinkedIn", - "whatsYourLinkedinProfileUrl": "¿Cuál es la URL de su perfil de LinkedIn?", - "invalidUrlError": "Escriba una URL de LinkedIn válida", - "linkedInBannerSuccessfullyExported": "Su banner de LinkedIn se ha exportado.", - "credentialSuccessfullyExported": "Su credencial se ha exportado.", - "linkedInBanner": "Banner de LinkedIn", - "linkedInProfile": "Perfil de LinkedIn", - "checkLinkedinProfile": "Comprobar un perfil de LinkedIn", + "thereIsNoAccountInYourWallet": "No hay ninguna cuenta en su cartera", + "credentialSuccessfullyExported": "Su credencial se ha exportado.", "scanAndDisplay": "Escanear y mostrar", "whatsNew": "Novedades", "okGotIt": "¡DE ACUERDO!", @@ -941,11 +926,8 @@ "theRequestIsRejected": "Se ha rechazado la solicitud.", "userPinIsIncorrect": "El PIN de usuario es incorrecto", "security_level": "Nivel de seguridad", - "oidc4vc_settings": "Configuración de OIDC4VC", "userPinTitle": "Flujo de dígitos del PIN de usuario pre-authorized_code", "userPinSubtitle": "Predeterminado: 6 dígitos\nActivar para administrar el código PIN de 4 dígitos", - "securityLevelTitle": "Nivel de cartera", - "securityLevelSubTitle": "Predeterminado: Permisivo\nDefina Estricto para fortalecer controles para emisores y verificadores.", "responseTypeNotSupported": "El tipo de respuesta no es compatible", "invalidRequest": "La solicitud no es válida", "subjectSyntaxTypeNotSupported": "El tipo de sintaxis de sujeto no es compatible.", @@ -967,14 +949,6 @@ "selectOneOfTheDid": "Seleccione uno de los DID", "subjectSyntaxType": "Tipo de sintaxis de sujeto", "enableToUseTheJWKThumprintOfTheKey": "Predeterminado: DID\nActívelo para utilizar la huella digital JWK de la llave", - "cryptographicHolderBinding": "Enlace de titular criptográfico", - "cryptographicHolderBindingSubtitle": "Predeterminado: Activado\nDesactívelo para aceptar credenciales de portador como tickets de seguridad baja.", - "scopeParameters": "Parámetros de ámbito", - "scopeParametersSubtitle": "Predeterminado: Desactivado\nActívelo para que la cartera utilice el ámbito en vez de authorization_details.", - "clientAuthenticationMethods": "Métodos de autenticación de cliente", - "clientAuthenticationMethodsSubtitle": "Predeterminado: ID de cliente como DID o JWK\nSeleccione otros métodos de autenticación si es necesario.", - "vcFormatType": "Formato VC", - "vcFormatTypeSubtitle": "Predeterminado: ldp_vc\nSeleccione uno de los formatos VC.", "theServiceIsNotAvailable": "Este servicio no está disponible", "issuerDID": "DID de emisor", "subjectDID": "DID de sujeto", @@ -992,9 +966,6 @@ "clientSecret": "Secreto de cliente", "walletProfiles": "Perfiles de cartera", "walletProfilesDescription": "Elija su perfil SSI o personalice el suyo propio", - "profileCustom": "Personalizado", - "profileEbsiV3": "European Blockchain Services Infrastructure", - "decentralizedIdentityInteropProfile": "Perfil de interoperabilidad de identidad descentralizada", "protectYourWallet": "Proteja su cartera", "protectYourWalletMessage": "Proteja y desbloquee su cartera con su huella dactilar, rostro o el PIN de su dispositivo. Datos cifrados de forma segura en este dispositivo.", "pinUnlock": "Desbloqueo con PIN", @@ -1014,8 +985,7 @@ "enterTheSecurityCode": "Escriba el código de seguridad", "yourEmail": "Su email", "publicKeyOfWalletInstance": "Clave pública de instancia de cartera", - "walletInstanceKey": "Clave de instancia de cartera", - "protocoleStandardRelease": "Versión estándar de protocolo", + "walletInstanceKey": "Clave de instancia de cartera", "organizationProfile": "Perfil de organización", "profileName": "Nombre de perfil", "companyName": "Nombre de la empresa", @@ -1028,41 +998,24 @@ "continueString": "Continuar", "walletProvider": "Proveedor de cartera", "clientTypeSubtitle" : "Predeterminado: DID\nDesplace para cambiar el tipo de cliente", - "proofHeader" : "Encabezado de Prueba de Posesión", - "proofHeaderSubtitle" : "Predeterminado: kid\nCambiar si necesita JWK en el encabezado.", - "theLdpFormatIsNotSupportedByThisDIDMethod": "El formato LDP no es compatible con este método DID.", "switchOffCryptoHolderBindingForThatDIDMethod": "Desactivar la vinculación del titular (o poseedor) de criptoactivos para ese método DID", "thisTypeProofCannotBeUsedWithThisVCFormat": "Este tipo de prueba no se puede utilizar con este formato de CV.", - "enterprise" : "Organización/Empresa", - "oWFBaselineProfile": "Perfil de Línea Base de OWF", - "defaultProfile" : "Predeterminado", "blockchainCardsDiscoverTitle": "Obtener prueba de propiedad de cuenta cripto", "blockchainCardsDiscoverSubtitle" : "Obtener prueba de propiedad de cuenta de criptoactivos", "successfullyAddedEnterpriseAccount":"¡Cuenta de Organización/Empresa añadida con éxito!", "successfullyUpdatedEnterpriseAccount": "¡Cuenta de Organiza ción/Empresa actualizada con éxito!", "languageSelectorTitle": "espagnol", - "proofType": "Tipo de prueba OIDC4VCI", - "proofTypeSubtitle": "Predeterminado: jwt\nSeleccione uno de los tipos de prueba.", "thisWalleIsAlreadyConfigured": "Esta cartera digital ya está configurada", "walletSettings": "Configuración de la cartera digital", "walletSettingsDescription": "Elige tu idioma", "phoneLanguage": "Idioma del teléfono", - "pushAuthorizationRequestTitle": "Solicitud de Autorización Push (PAR)", - "pushAuthorizationRequestSubTitle": "Predeterminado: false\nHabilitar para asegurar el flujo del código de autorización", "cardIsValid": "La tarjeta es válida", "cardIsExpired": "La tarjeta ha caducado", "signatureIsInvalid": "La firma no es válida", "statusIsInvalid": "El estado no es válido", "statuslListSignatureFailed": "Error en la firma de la lista de estado", - "walletMetadataForIssuers": "Metadatos de la cartera para emisores", - "walletMetadataForVerifiers": "Metadatos de la cartera para verificadores", - "statusListCachingTitle": "Almacenamiento en memoria caché de la lista de estados", - "statusListCachingSubTitle": "Predeterminado: Activado\nApague para recargar la lista de estados cuando sea necesario", "statusList": "Lista de estados", "statusListIndex": "Índice de lista de estados", "theWalletIsSuspended": "La cartera digital está suspendida.", - "clientTypeTitle": "Esquema Client_id de la cartera digital", - "confidentialClient": "Cliente confidencial", "jwkThumbprintP256Key": "Huella digital JWK P-256" - } \ No newline at end of file diff --git a/lib/l10n/arb/app_fr.arb b/lib/l10n/arb/app_fr.arb index 6af25f4cf..5ecca94d6 100644 --- a/lib/l10n/arb/app_fr.arb +++ b/lib/l10n/arb/app_fr.arb @@ -570,7 +570,6 @@ "otherCredentialDiscoverSubtitle": "Autres types de documents numériques que vous pouvez ajouter", "showMore": "...Afficher plus", "showLess": "Afficher moins...", - "youHaveReceivedARewardOf": "Vous avez reçu une récompense de", "gotIt": "J'ai compris", "transactionErrorBalanceTooLow": "Votre solde n'est pas suffisant", "transactionErrorCannotPayStorageFee": "Les frais sont supérieurs à votre solde", @@ -597,9 +596,6 @@ "twitterWhyGetThisCard": "Cette carte est une preuve que vous possédez votre compte Twitter. Utilisez-la pour prouver la propriété de votre compte Twitter chaque fois que vous en avez besoin.", "twitterExpirationDate": "Cette carte sera active pendant 1 an.", "twitterDummyDesc": "Prouvez la propriété de votre compte Twitter", - "linkedinCardHowToGetIt": "Vous pouvez obtenir cette preuve en suivant une vérification d'identité. Seules les informations relatives à votre prénom, nom, nationalité et année de naissance seront accessibles depuis votre profil LinkedIn.", - "linkedinCardWhyGetThisCard": "Cette carte est une preuve de votre identité pour votre profil LinkedIn. A partir de cette carte, vous pouvez exporter un QR code et l'afficher dans la bannière de votre compte LinkedIn. En scannant le QR code avec son portefeuille Altme, n'importe qui pourra vérifier que votre identité correspond à l'URL de votre profil LinkedIn, et pourra également accéder à 2 informations complémentaires : votre nationalité et votre année de naissance.", - "linkedinCardExpirationDate": "Cette carte restera active et réutilisable pendant 1 AN.", "tezotopiaMembershipHowToGetIt": "Vous devez présenter une preuve de nationalité et une preuve de tranche d'âge. Obtenez-les en suivant le KYC d'Altme.", "over18WhyGetThisCard": "Cette preuve peut être exigée par certaines Applications / Sites Web du Web 3 pour accéder à leur service ou obtenir des avantages : Carte de membre, Carte de fidélité, Rewards, etc.", "over18ExpirationDate": "Cette carte restera active et réutilisable pendant 1 AN.", @@ -635,9 +631,6 @@ "defiComplianceWhyGetThisCard": "Obtenez une preuve de conformité KYC/AML, souvent demandée par les protocoles DeFi conformes et les applications Web3. Une fois obtenue, vous pourrez obtenir un NFT non transférable pour être vérifiée directement on-chain sans révéler vos données personnelles.", "defiComplianceExpirationDate": "Cette preuve restera active pendant 3 mois. Le renouvellement nécessite une vérification simple, sans nouveau KYC.", "defiComplianceHowToGetIt": "C'est facile ! Effectuez une vérification KYC dans le portefeuille Altme (par ID360) et demandez votre attestation de conformité DeFi.", - "rewardDialogTitle": "Félicitations 🥳", - "rewardDialogDescPart1": "Vous venez de recevoir", - "rewardDialogDescPart2": "Sur votre compte", "origin": "Origine", "nftTooBigToLoad": "En cours de chargement", "seeTransaction": "Voir la transaction", @@ -769,16 +762,8 @@ "softwareLicenses": "Licences logicielles", "notAValidWalletAddress": "L'adresse n'est pas valide !", "otherAccount": "Autre compte", - "thereIsNoAccountInYourWallet": "Il n'y a pas de compte dans votre portefeuille", - "exportToLinkedIn": "Exporter vers LinkedIn", - "addLinkedInInfo": "Ajouter des informations LinkedIn", - "whatsYourLinkedinProfileUrl": "Quelle est l'URL de votre profil linkedIn ?", - "invalidUrlError": "Veuillez saisir une URL LinkedIn valide", - "linkedInBannerSuccessfullyExported": "Votre bannière LinkedIn a été exportée avec succès.", - "credentialSuccessfullyExported": "Votre identifiant a été exporté avec succès.", - "linkedInBanner": "Bannière Linkedin", - "linkedInProfile": "Profil Linkedin", - "checkLinkedinProfile": "Vérifier votre profil Linkedin", + "thereIsNoAccountInYourWallet": "Il n'y a pas de compte dans votre portefeuille", + "credentialSuccessfullyExported": "Votre identifiant a été exporté avec succès.", "scanAndDisplay": "Numériser et afficher", "whatsNew": "Nouveautés", "okGotIt": "Ok, compris !", @@ -941,11 +926,8 @@ "theRequestIsRejected": "La demande est rejetée.", "userPinIsIncorrect": "Le code PIN utilisateur est incorrect", "security_level": "Niveau de Sécurité", - "oidc4vc_settings": "Paramètres OIDC4VC", "userPinTitle": "User PIN Digits pre-authorized_code Flow", "userPinSubtitle": "Par défaut : 6 chiffres\nActivez pour avoir un code PIN à 4 chiffres", - "securityLevelTitle": "Niveau du Portefeuille", - "securityLevelSubTitle": "Default: Permissive\nSet to Strict to strengthen controls for issuers and verifiers", "responseTypeNotSupported": "Le type de réponse n'est pas pris en charge", "invalidRequest": "La demande n'est pas valide", "subjectSyntaxTypeNotSupported": "Le type de syntaxe n'est pas pris en charge.", @@ -966,16 +948,6 @@ "defaultDid": "DID par Défaut", "selectOneOfTheDid": "Sélectionnez l'un des DIDs", "clientTypeSubtitle": "Par défaut : DID\nSwitch pour changer le type de client", - "cryptographicHolderBinding": "Liaison du Titulaire Cryptographique", - "cryptographicHolderBindingSubtitle": "Par défaut : On\nDisable cryptographic binding for claim based binding credentials.", - "scopeParameters": "Paramètres", - "scopeParametersSubtitle": "Off\nEnable to force wallet to use scope instead of authorization_details.", - "clientAuthenticationMethods": "Méthodes d'authentification", - "clientAuthenticationMethodsSubtitle": "Default: Client id as DID or JWK\nSelect to other authentication methods if needed.", - "vcFormatType": "Type de Format de VC", - "vcFormatTypeSubtitle": "Par défaut : ldp_vc\nSélectionnez l'un des formats VC.", - "proofHeader": "Type de Preuve OIDC4VCI Jwt", - "proofHeaderSubtitle": "Par défaut : kid\nChangez si un JWK est nécessaire dans l'en-tête.", "theServiceIsNotAvailable": "Le service n'est pas disponible", "issuerDID": "DID de l'Émetteur", "subjectDID": "DID du Sujet", @@ -993,9 +965,6 @@ "clientSecret": "Secret client", "walletProfiles": "Profils de portefeuille", "walletProfilesDescription": "Choisissez votre profil SSI", - "profileCustom": "Personnalisé", - "profileEbsiV3": "Blockchain Européenne EBSI", - "decentralizedIdentityInteropProfile": "Profil DIIP", "protectYourWallet": "Protégez votre portefeuille", "protectYourWalletMessage": "Utilisez votre empreinte digitale, votre visage ou le code PIN de votre appareil pour sécuriser et déverrouiller votre portefeuille.", "pinUnlock": "Déverrouillage par PIN", @@ -1015,8 +984,7 @@ "enterTheSecurityCode": "Entrez le code de sécurité", "yourEmail": "Votre email", "publicKeyOfWalletInstance": "Clé Publique de l'Instance de Portefeuille", - "walletInstanceKey": "Clé d'instance du portefeuille", - "protocoleStandardRelease": "Publication standard du protocole", + "walletInstanceKey": "Clé d'instance du portefeuille", "organizationProfile": "Profil de l'organisation", "profileName": "Nom du profil", "companyName": "Nom de l'entreprise", @@ -1030,15 +998,10 @@ "walletProvider": "Fournisseur de Portefeuille", "theLdpFormatIsNotSupportedByThisDIDMethod": "Le format LDP n'est pas pris en charge par cette méthode DID.", "thisTypeProofCannotBeUsedWithThisVCFormat": "Ce type de preuve ne peut pas être utilisé avec ce format de VC.", - "enterprise": "Entreprise", - "oWFBaselineProfile": "Profil de base OWF", - "defaultProfile":"Profil par défaut", "blockchainCardsDiscoverTitle": "Prouvez que vous possédez un compte crypto.", "blockchainCardsDiscoverSubtitle": "Prouvez que vous possédez un compte crypto.", "successfullyAddedEnterpriseAccount": "Compte entreprise ajouté avec succès !", "successfullyUpdatedEnterpriseAccount": "Compte entreprise mis à jour avec succès !", - "proofType": "Type de preuve OIDC4VCI", - "proofTypeSubtitle": "Par défault: jwt\nSéléctionnez un type de preuve.", "thisWalleIsAlreadyConfigured": "Ce wallet est déjà configuré", "walletSettings": "Paramètres du wallet", "walletSettingsDescription": "Choisissez votre langue", diff --git a/lib/l10n/untranslated.json b/lib/l10n/untranslated.json index 44852abd9..4577f5458 100644 --- a/lib/l10n/untranslated.json +++ b/lib/l10n/untranslated.json @@ -44,22 +44,14 @@ ], "fr": [ - "pushAuthorizationRequestTitle", - "pushAuthorizationRequestSubTitle", "cardIsValid", "cardIsExpired", "signatureIsInvalid", "statusIsInvalid", "statuslListSignatureFailed", - "walletMetadataForIssuers", - "walletMetadataForVerifiers", - "statusListCachingTitle", - "statusListCachingSubTitle", "statusList", "statusListIndex", "theWalletIsSuspended", - "clientTypeTitle", - "confidentialClient", "jwkThumbprintP256Key", "walletBlockedPopupTitle", "walletBlockedPopupDescription", diff --git a/lib/oidc4vc/add_credential_data.dart b/lib/oidc4vc/add_credential_data.dart index bd724a908..5b5ce0dc6 100644 --- a/lib/oidc4vc/add_credential_data.dart +++ b/lib/oidc4vc/add_credential_data.dart @@ -22,6 +22,7 @@ Future addCredentialData({ required bool isLastCall, required JWTDecode jwtDecode, required BlockchainType blockchainType, + required QRCodeScanCubit qrCodeScanCubit, }) async { for (int i = 0; i < encodedCredentialOrFutureTokens.length; i++) { final data = encodedCredentialOrFutureTokens[i]; @@ -91,6 +92,7 @@ Future addCredentialData({ isLastCall && i + 1 == encodedCredentialOrFutureTokens.length, isPendingCredential: true, blockchainType: blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); } else { await addOIDC4VCCredential( @@ -104,6 +106,7 @@ Future addCredentialData({ openIdConfiguration: openIdConfiguration, jwtDecode: jwtDecode, blockchainType: blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); } } diff --git a/lib/oidc4vc/add_oidc4vc_credential.dart b/lib/oidc4vc/add_oidc4vc_credential.dart index 22484f55e..f409f378c 100644 --- a/lib/oidc4vc/add_oidc4vc_credential.dart +++ b/lib/oidc4vc/add_oidc4vc_credential.dart @@ -18,6 +18,7 @@ Future addOIDC4VCCredential({ required String format, required OpenIdConfiguration? openIdConfiguration, required JWTDecode jwtDecode, + required QRCodeScanCubit qrCodeScanCubit, String? credentialIdToBeDeleted, String? issuer, }) async { @@ -32,7 +33,7 @@ Future addOIDC4VCCredential({ final jsonContent = jwtDecode.parseJwt(data); if (format == VCFormatType.vcSdJWT.vcValue) { - final sdAlg = jsonContent['_sd_alg']??'sha-256'; + final sdAlg = jsonContent['_sd_alg'] ?? 'sha-256'; if (sdAlg != 'sha-256') { throw ResponseMessage( @@ -201,5 +202,6 @@ Future addOIDC4VCCredential({ showStatus: false, showMessage: isLastCall, blockchainType: blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); } diff --git a/lib/oidc4vc/get_and_add_deffered_credential.dart b/lib/oidc4vc/get_and_add_deffered_credential.dart index 81915e146..67d6edb51 100644 --- a/lib/oidc4vc/get_and_add_deffered_credential.dart +++ b/lib/oidc4vc/get_and_add_deffered_credential.dart @@ -15,6 +15,7 @@ Future getAndAddDefferedCredential({ required OIDC4VCIDraftType oidc4vciDraftType, required BlockchainType blockchainType, required String? issuer, + required QRCodeScanCubit qrCodeScanCubit, }) async { Map? credentialHeaders; Map? body; @@ -68,5 +69,6 @@ Future getAndAddDefferedCredential({ openIdConfiguration: null, jwtDecode: jwtDecode, blockchainType: blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); } diff --git a/lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart b/lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart index f81f0228f..aa62d62ac 100644 --- a/lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart +++ b/lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart @@ -139,6 +139,7 @@ Future initiateOIDC4VCCredentialIssuance({ clientSecret: clientSecret, oAuthClientAttestation: oAuthClientAttestation, oAuthClientAttestationPop: oAuthClientAttestationPop, + qrCodeScanCubit: qrCodeScanCubit, ); } } @@ -151,6 +152,7 @@ Future initiateOIDC4VCCredentialIssuance({ isEBSIV3: isEBSIV3, credentialOfferJson: credentialOfferJson, selectedCredentials: [credentials], + qrCodeScanCubit: qrCodeScanCubit, ); } } diff --git a/lib/polygon_id/cubit/polygon_id_cubit.dart b/lib/polygon_id/cubit/polygon_id_cubit.dart index 458370e98..885d3388c 100644 --- a/lib/polygon_id/cubit/polygon_id_cubit.dart +++ b/lib/polygon_id/cubit/polygon_id_cubit.dart @@ -498,7 +498,9 @@ class PolygonIdCubit extends Cubit { return claims; } - Future addPolygonIdCredentials() async { + Future addPolygonIdCredentials({ + required QRCodeScanCubit qrCodeScanCubit, + }) async { try { log.i('add Claims'); emit(state.copyWith(status: AppStatus.loading)); @@ -506,6 +508,7 @@ class PolygonIdCubit extends Cubit { await addToList( claimEntity: state.claims![i], credentialManifest: state.credentialManifests![i], + qrCodeScanCubit: qrCodeScanCubit, ); } emit(state.copyWith(status: AppStatus.goBack)); @@ -531,6 +534,7 @@ class PolygonIdCubit extends Cubit { Future addToList({ required ClaimEntity claimEntity, required CredentialManifest credentialManifest, + required QRCodeScanCubit qrCodeScanCubit, }) async { final jsonCredential = claimEntity.info; final credentialPreview = Credential.fromJson(jsonCredential); @@ -551,6 +555,7 @@ class PolygonIdCubit extends Cubit { await credentialsCubit.insertCredential( credential: credentialModel, blockchainType: walletCubit.state.currentAccount!.blockchainType, + qrCodeScanCubit: qrCodeScanCubit, ); } diff --git a/lib/scan/cubit/scan_cubit.dart b/lib/scan/cubit/scan_cubit.dart index 7f67490c4..c5b8dbe1d 100644 --- a/lib/scan/cubit/scan_cubit.dart +++ b/lib/scan/cubit/scan_cubit.dart @@ -30,8 +30,6 @@ part 'scan_state.dart'; ///the wallet stores the VC /// If needed the wallet builds a VP with the VC and sends it to a Verifier -/// In LinkedIn case the VP is embedded in the QR code, not sent to the verifier - class ScanCubit extends Cubit { ScanCubit({ required this.client, @@ -59,7 +57,7 @@ class ScanCubit extends Cubit { required String keyId, required List? credentialsToBePresented, required Issuer issuer, - QRCodeScanCubit? qrCodeScanCubit, + required QRCodeScanCubit qrCodeScanCubit, }) async { emit(state.loading()); await Future.delayed(const Duration(milliseconds: 500)); @@ -110,7 +108,7 @@ class ScanCubit extends Cubit { privateKey: privateKey, stateValue: stateValue, idTokenNeeded: hasIDToken(responseType), - qrCodeScanCubit: qrCodeScanCubit!, + qrCodeScanCubit: qrCodeScanCubit, ); return; } else { @@ -282,6 +280,7 @@ class ScanCubit extends Cubit { activities: activities, credentialManifest: credentialManifest, ), + qrCodeScanCubit: qrCodeScanCubit, ); if (credentialsToBePresented != null) { @@ -873,6 +872,7 @@ class ScanCubit extends Cubit { clientMetaData: clientMetaData, presentationDefinition: presentationDefinition, vcFormatType: vcFormatType, + credentialsToBePresented: credentialsToBePresented, ); if (presentLdpVc) { diff --git a/lib/selective_disclosure/widget/display_selective_disclosure.dart b/lib/selective_disclosure/widget/display_selective_disclosure.dart index c94cc9d14..074f1b41a 100644 --- a/lib/selective_disclosure/widget/display_selective_disclosure.dart +++ b/lib/selective_disclosure/widget/display_selective_disclosure.dart @@ -180,7 +180,7 @@ class DisplaySelectiveDisclosure extends StatelessWidget { child: Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Flexible( + Expanded( child: CredentialField( padding: EdgeInsets.only(top: isFirstElement ? 10 : 0), diff --git a/lib/splash/bloclisteners/blocklisteners.dart b/lib/splash/bloclisteners/blocklisteners.dart index fd1344a12..14d415cce 100644 --- a/lib/splash/bloclisteners/blocklisteners.dart +++ b/lib/splash/bloclisteners/blocklisteners.dart @@ -434,6 +434,7 @@ final qrCodeBlocListener = BlocListener( openIdConfiguration: openIdConfigurationForIssuance, issuer: issuerForIssuance, preAuthorizedCode: preAuthorizedCodeForIssuance, + uri: state.uri!, ); } else { context.read().emitError( @@ -495,6 +496,7 @@ final qrCodeBlocListener = BlocListener( await context.read().authorizedFlowCompletion( statePayload: statePayload, codeForAuthorisedFlow: codeForAuthorisedFlow, + qrCodeScanCubit: context.read(), ); } } catch (e) { @@ -570,7 +572,7 @@ final qrCodeBlocListener = BlocListener( ) ?? true; - context.read().completer!.complete(moveAhead); + context.read().completer?.complete(moveAhead); LoadingView().show(context: context); } @@ -872,6 +874,7 @@ final enterpriseBlocListener = BlocListener( if (state.status == AppStatus.revoked) { showDialog( context: context, + barrierDismissible: false, builder: (_) => const WalletRevokedDialog(), ); } diff --git a/lib/splash/cubit/splash_cubit.dart b/lib/splash/cubit/splash_cubit.dart index c958c22e8..b526fb92d 100644 --- a/lib/splash/cubit/splash_cubit.dart +++ b/lib/splash/cubit/splash_cubit.dart @@ -60,11 +60,6 @@ class SplashCubit extends Cubit { } emit(state.copyWith(status: SplashStatus.routeToPassCode)); - // if (Parameters.walletHandlesCrypto) { - // unawaited( - // homeCubit.periodicCheckRewardOnTezosBlockchain(), - // ); - // } } else { homeCubit.emitHasNoWallet(); emit(state.copyWith(status: SplashStatus.routeToOnboarding)); diff --git a/lib/splash/view/splash_page.dart b/lib/splash/view/splash_page.dart index 6a778b77f..4a54d0733 100644 --- a/lib/splash/view/splash_page.dart +++ b/lib/splash/view/splash_page.dart @@ -130,7 +130,10 @@ class _SplashViewState extends State { } if (uri.toString().startsWith('configuration://?')) { - await context.read().requestTheConfiguration(uri!); + await context.read().requestTheConfiguration( + uri: uri!, + qrCodeScanCubit: context.read(), + ); return; } diff --git a/packages/jwt_decode/lib/src/jwt_decode.dart b/packages/jwt_decode/lib/src/jwt_decode.dart index 2eafff5b8..87d8cdc25 100644 --- a/packages/jwt_decode/lib/src/jwt_decode.dart +++ b/packages/jwt_decode/lib/src/jwt_decode.dart @@ -7,9 +7,6 @@ class JWTDecode { ///parseJwt Map parseJwt(String token) { final parts = token.split('.'); - if (parts.length != 3) { - throw Exception('INVALID_TOKEN'); - } final payload = _decodeBase64(parts[1]); @@ -23,9 +20,6 @@ class JWTDecode { ///parseJwt to get header Map parseJwtHeader(String token) { final parts = token.split('.'); - if (parts.length != 3) { - throw Exception('INVALID_TOKEN'); - } final header = _decodeBase64(parts[0]); diff --git a/pubspec.yaml b/pubspec.yaml index ce7b9e97a..d2d655d7b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: altme description: AltMe Flutter App -version: 2.9.0+469 +version: 2.9.6+475 publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: sdk: ">=3.1.0 <4.0.0" @@ -93,7 +93,6 @@ dependencies: pretty_qr_code: ^3.1.0 qr_flutter: ^4.1.0 random_string: ^2.3.1 - screenshot: ^3.0.0 secure_application: ^3.8.0 secure_storage: path: packages/secure_storage diff --git a/test/app/shared/enum/credential_subject_type/credential_subject_type_extension_test.dart b/test/app/shared/enum/credential_subject_type/credential_subject_type_extension_test.dart index b01c5937b..967f49cd3 100644 --- a/test/app/shared/enum/credential_subject_type/credential_subject_type_extension_test.dart +++ b/test/app/shared/enum/credential_subject_type/credential_subject_type_extension_test.dart @@ -134,11 +134,6 @@ void main() { equals(Colors.white), ); - expect( - CredentialSubjectType.linkedInCard.defaultBackgroundColor, - equals(Colors.white), - ); - expect( CredentialSubjectType.over13.defaultBackgroundColor, equals(Colors.white), @@ -415,7 +410,6 @@ void main() { CredentialSubjectType.verifiableIdCard.name, equals('VerifiableId'), ); - expect(CredentialSubjectType.linkedInCard.name, equals('LinkedinCard')); expect( CredentialSubjectType.learningAchievement.name, equals('LearningAchievement'), @@ -603,8 +597,7 @@ void main() { value == CredentialSubjectType.ageRange || value == CredentialSubjectType.nationality || value == CredentialSubjectType.gender || - value == CredentialSubjectType.passportFootprint || - value == CredentialSubjectType.linkedInCard) { + value == CredentialSubjectType.passportFootprint) { expect(value.byPassDeepLink, isTrue); } else { expect(value.byPassDeepLink, isFalse); @@ -715,7 +708,6 @@ void main() { expect(CredentialSubjectType.emailPass.title, 'Email Pass'); expect(CredentialSubjectType.identityPass.title, 'Identity Pass'); expect(CredentialSubjectType.verifiableIdCard.title, 'VerifiableId'); - expect(CredentialSubjectType.linkedInCard.title, 'Linkedin Card'); expect( CredentialSubjectType.learningAchievement.title, 'Learning Achievement', @@ -848,7 +840,6 @@ void main() { ); expect(CredentialSubjectType.defaultCredential.supportSingleOnly, false); expect(CredentialSubjectType.emailPass.supportSingleOnly, false); - expect(CredentialSubjectType.linkedInCard.supportSingleOnly, false); expect( CredentialSubjectType.learningAchievement.supportSingleOnly, false, @@ -1068,10 +1059,7 @@ void main() { CredentialSubjectType.defaultCredential.getVCFormatType, [VCFormatType.jwtVc], ); - expect( - CredentialSubjectType.linkedInCard.getVCFormatType, - [VCFormatType.jwtVc], - ); + expect( CredentialSubjectType.learningAchievement.getVCFormatType, [VCFormatType.jwtVc], @@ -1178,7 +1166,6 @@ void main() { expect(CredentialSubjectType.emailPass.order, 99); expect(CredentialSubjectType.identityPass.order, 90); expect(CredentialSubjectType.verifiableIdCard.order, 97.5); - expect(CredentialSubjectType.linkedInCard.order, 86); expect(CredentialSubjectType.learningAchievement.order, 0); expect(CredentialSubjectType.over13.order, 97.3); expect(CredentialSubjectType.over15.order, 97.2); diff --git a/test/app/shared/enum/type/profile/profile_type_test.dart b/test/app/shared/enum/type/profile/profile_type_test.dart index 08ba5c82d..3d216f10e 100644 --- a/test/app/shared/enum/type/profile/profile_type_test.dart +++ b/test/app/shared/enum/type/profile/profile_type_test.dart @@ -6,9 +6,9 @@ void main() { test('Show Sponsered By', () { expect(ProfileType.custom.showSponseredBy, false); expect(ProfileType.ebsiV3.showSponseredBy, true); - expect(ProfileType.dutch.showSponseredBy, false); + expect(ProfileType.diipv2point1.showSponseredBy, false); expect(ProfileType.enterprise.showSponseredBy, true); - expect(ProfileType.owfBaselineProfile.showSponseredBy, true); + expect(ProfileType.diipv3.showSponseredBy, true); expect(ProfileType.defaultOne.showSponseredBy, false); }); }); diff --git a/test/app/shared/helper_functions/helper_functions_test.dart b/test/app/shared/helper_functions/helper_functions_test.dart index cec8dd02a..dad2c0f0d 100644 --- a/test/app/shared/helper_functions/helper_functions_test.dart +++ b/test/app/shared/helper_functions/helper_functions_test.dart @@ -1084,6 +1084,7 @@ void main() { ), ), clientMetaData: null, + credentialsToBePresented: [], ), (true, false, false, false), ); @@ -1102,6 +1103,7 @@ void main() { vcFormatType: VCFormatType.ldpVc, presentationDefinition: presentationDefinition, clientMetaData: null, + credentialsToBePresented: [], ), throwsA( isA().having((e) => e.data, '', { @@ -1124,6 +1126,7 @@ void main() { format: null, ), clientMetaData: null, + credentialsToBePresented: [], ), (false, true, false, false), ); @@ -1141,6 +1144,7 @@ void main() { format: null, ), clientMetaData: null, + credentialsToBePresented: [], ), (false, false, true, false), ); @@ -1158,6 +1162,7 @@ void main() { format: null, ), clientMetaData: null, + credentialsToBePresented: [], ), (false, false, false, true), ); @@ -1179,6 +1184,7 @@ void main() { 'jwt_vc_json': 'here', }, }, + credentialsToBePresented: [], ), (false, false, true, false), ); @@ -1200,6 +1206,7 @@ void main() { 'vc+sd-jwt': 'here', }, }, + credentialsToBePresented: [], ), (false, false, false, true), ); diff --git a/test/app/shared/widget/wallet_logo_test.dart b/test/app/shared/widget/wallet_logo_test.dart index fff40b6fc..e4daa27a8 100644 --- a/test/app/shared/widget/wallet_logo_test.dart +++ b/test/app/shared/widget/wallet_logo_test.dart @@ -172,12 +172,13 @@ void main() { }); }); - testWidgets('displays correct image for ProfileType.dutch in development', + testWidgets( + 'displays correct image for ProfileType.diipv2point1 in development', (WidgetTester tester) async { when(() => mockFlavorCubit.state).thenReturn(FlavorMode.development); when(() => mockProfileCubit.state).thenReturn( ProfileState( - model: ProfileModel.dutch( + model: ProfileModel.diipv2point1( polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, walletType: WalletType.personal, walletProtectionType: WalletProtectionType.FA2, @@ -213,7 +214,7 @@ void main() { final Image image = tester.widget(imageFinder); final AssetImage imageProvider = image.image as AssetImage; - expect(imageProvider.assetName, ImageStrings.appLogoDev); + expect(imageProvider.assetName, ImageStrings.diipLogo); }); testWidgets('displays correct image for ProfileType.ebsiV3 in development', @@ -262,12 +263,11 @@ void main() { testWidgets( 'displays correct image for ' - 'ProfileType.owfBaselineProfile in development', - (WidgetTester tester) async { + 'ProfileType.diipv3 in development', (WidgetTester tester) async { when(() => mockFlavorCubit.state).thenReturn(FlavorMode.development); when(() => mockProfileCubit.state).thenReturn( ProfileState( - model: ProfileModel.owfBaselineProfile( + model: ProfileModel.diipv3( polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, walletType: WalletType.personal, walletProtectionType: WalletProtectionType.FA2, @@ -303,7 +303,7 @@ void main() { final Image image = tester.widget(imageFinder); final AssetImage imageProvider = image.image as AssetImage; - expect(imageProvider.assetName, ImageStrings.owfBaselineProfileLogo); + expect(imageProvider.assetName, ImageStrings.diipLogo); }); testWidgets(