StatusList2021Credential.fromJson constructor

StatusList2021Credential.fromJson(
  1. dynamic jsonData
)

Implementation

StatusList2021Credential.fromJson(super.jsonData)
    : super.fromJson() {
  var purpose = credentialSubject['statusPurpose'];
  if (purpose == CredentialStatus2021Purpose.revocation.value) {
    statusPurpose = CredentialStatus2021Purpose.revocation;
  } else if (purpose == CredentialStatus2021Purpose.suspension.value) {
    statusPurpose = CredentialStatus2021Purpose.suspension;
  } else {
    throw Exception('Unknown StatusPurpose');
  }
}