CredentialFulfillment.fromJson constructor
CredentialFulfillment.fromJson(
- dynamic jsonObject
Implementation
CredentialFulfillment.fromJson(dynamic jsonObject) {
var map = credentialToMap(jsonObject);
if (map.containsKey('id')) {
id = map['id'];
} else {
throw Exception('id property needed in credential fulfillment');
}
if (map.containsKey('manifest_id')) {
manifestId = map['manifest_id'];
} else {
throw Exception('manifest_id property needed in credential fulfillment');
}
applicationId = map['application_id'];
if (map.containsKey('descriptor_map')) {
List tmp = map['descriptor_map'];
descriptorMap =
tmp.map((e) => InputDescriptorMappingObject.fromJson(e)).toList();
} else {
throw Exception(
'descriptor_map property needed in credential fulfillment');
}
}