1/ check for error on verification. What is currently done with credential offer.
if (jsonVerification['warnings'].isNotEmpty) {
log.warning('credential verification return warnings',
jsonVerification['warnings']);
emit(ScanStateMessage(StateMessage.warning(
'Credential verification returned some warnings. '
'Check the logs for more information.')));
}
if (jsonVerification['errors'].isNotEmpty) {
log.severe('failed to verify credential', jsonVerification['errors']);
if (jsonVerification['errors'][0] != 'No applicable proof') {
emit(ScanStateMessage(
StateMessage.error('Failed to verify credential. '
'Check the logs for more information.')));
}
}
2/ record credential
await walletBloc.insertCredential(CredentialModel.copyWithData(
oldCredentialModel: credentialModel, newData: jsonCredential));
Where:
jsonCredential is the credential coming from didKit
credentialModel is final credential = CredentialModel.fromJson(state.preview);
and state.preview = response is String ? jsonDecode(jsonCredential) : jsonCredential;
1/ check for error on verification. What is currently done with credential offer. if (jsonVerification['warnings'].isNotEmpty) { log.warning('credential verification return warnings', jsonVerification['warnings']);
2/ record credential await walletBloc.insertCredential(CredentialModel.copyWithData( oldCredentialModel: credentialModel, newData: jsonCredential)); Where:
and state.preview = response is String ? jsonDecode(jsonCredential) : jsonCredential;