ProposeCredential.fromJson constructor
ProposeCredential.fromJson(
- dynamic jsonObject
Implementation
ProposeCredential.fromJson(super.jsonObject) : super.fromJson() {
if (type != DidcommMessages.proposeCredential) {
throw Exception('Unknown Message type or version');
}
goalCode = body['goal_code'];
comment = body['comment'];
if (body.containsKey('credential_preview')) {
credentialPreview =
PreviewCredential.fromJson(body['credential_preview']);
}
if (attachments != null && attachments!.isNotEmpty) {
detail = [];
for (var a in attachments!) {
if (a.format != null && a.format == AttachmentFormat.ldProofVcDetail) {
if (a.mediaType != null && a.mediaType == 'application/json') {
a.data.resolveData();
detail!.add(LdProofVcDetail.fromJson(a.data.json!));
}
} else if (a.format != null &&
a.format == AttachmentFormat.credentialManifestAries) {
throw UnimplementedError(
'dif credential Manifest Attachment is not supported yet');
} else if (a.format != null &&
a.format == AttachmentFormat.indyCredentialFilter) {
throw UnimplementedError('indy Attachment is not supported');
} else {
continue;
}
}
}
}