Skip to content

Commit

Permalink
feat: Added detaisl on the deferred VC #1878
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Oct 6, 2023
1 parent eb1ac7e commit a81d93d
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,31 @@ class _CredentialsDetailsViewState extends State<CredentialsDetailsView> {
Theme.of(context).colorScheme.valueColor,
),
],
if (widget.credentialModel.pendingInfo != null) ...[
CredentialField(
padding: const EdgeInsets.symmetric(
horizontal: 0,
vertical: 8,
),
title: l10n.issuer,
value: widget.credentialModel.pendingInfo!.issuer,
titleColor:
Theme.of(context).colorScheme.titleColor,
valueColor:
Theme.of(context).colorScheme.valueColor,
),
CredentialField(
padding: EdgeInsets.zero,
title: l10n.dateOfRequest,
value: UiDate.formatDate(
widget.credentialModel.pendingInfo!.requestedAt,
),
titleColor:
Theme.of(context).colorScheme.titleColor,
valueColor:
Theme.of(context).colorScheme.valueColor,
),
],
],
if (state.credentialDetailTabStatus ==
CredentialDetailTabStatus.activity) ...[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class PendingInfo extends Equatable {
required this.deferredCredentialEndpoint,
required this.format,
required this.url,
required this.issuer,
required this.requestedAt,
});

factory PendingInfo.fromJson(Map<String, dynamic> json) =>
Expand All @@ -19,6 +21,8 @@ class PendingInfo extends Equatable {
final String deferredCredentialEndpoint;
final String format;
final String url;
final String issuer;
final DateTime requestedAt;

Map<String, dynamic> toJson() => _$PendingInfoToJson(this);

Expand Down
3 changes: 2 additions & 1 deletion lib/l10n/arb/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@
"credentialIssuanceDenied": "Credential issuance denied",
"thisCredentialFormatIsNotSupported": "This credential format is not supported",
"moreDetails": "More Details",
"theCredentialOfferIsInvalid": "The credential offer is invalid"
"theCredentialOfferIsInvalid": "The credential offer is invalid",
"dateOfRequest": "Date of Request"
}

12 changes: 8 additions & 4 deletions lib/l10n/untranslated.json
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,8 @@
"credentialIssuanceDenied",
"thisCredentialFormatIsNotSupported",
"moreDetails",
"theCredentialOfferIsInvalid"
"theCredentialOfferIsInvalid",
"dateOfRequest"
],

"es": [
Expand Down Expand Up @@ -1772,7 +1773,8 @@
"credentialIssuanceDenied",
"thisCredentialFormatIsNotSupported",
"moreDetails",
"theCredentialOfferIsInvalid"
"theCredentialOfferIsInvalid",
"dateOfRequest"
],

"fr": [
Expand Down Expand Up @@ -1963,7 +1965,8 @@
"credentialIssuanceDenied",
"thisCredentialFormatIsNotSupported",
"moreDetails",
"theCredentialOfferIsInvalid"
"theCredentialOfferIsInvalid",
"dateOfRequest"
],

"it": [
Expand Down Expand Up @@ -2851,6 +2854,7 @@
"credentialIssuanceDenied",
"thisCredentialFormatIsNotSupported",
"moreDetails",
"theCredentialOfferIsInvalid"
"theCredentialOfferIsInvalid",
"dateOfRequest"
]
}
2 changes: 2 additions & 0 deletions lib/oidc4vc/get_and_add_credential.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ Future<void> getAndAddCredential({
deferredCredentialEndpoint: deferredCredentialEndpoint,
format: format,
url: scannedResponse,
issuer: issuer,
requestedAt: DateTime.now(),
),
);
// insert the credential in the wallet
Expand Down

0 comments on commit a81d93d

Please sign in to comment.