Skip to content

Commit

Permalink
show response messge for 212 and 412
Browse files Browse the repository at this point in the history
  • Loading branch information
TalebRafiepour committed Jul 18, 2023
1 parent 975afa3 commit 988fffd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
6 changes: 5 additions & 1 deletion lib/app/shared/alert_message/alert_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ class AlertMessage {
String message = '';

if (messageHandler != null) {
message = messageHandler.getMessage(context, messageHandler);
if (messageHandler is NetworkException && messageHandler.data is String) {
message = messageHandler.data as String;
} else {
message = messageHandler.getMessage(context, messageHandler);
}
}

if (stringMessage != null) {
Expand Down
17 changes: 12 additions & 5 deletions lib/scan/cubit/scan_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -323,21 +323,28 @@ class ScanCubit extends Cubit<ScanState> {
'presentation': presentation,
});

await client.post(url, data: formData);
final result = await client.post(url, data: formData);

await presentationActivity(
credentialModels: credentialsToBePresented,
issuer: issuer,
);

String? responseMessage;
if (result is String?) {
responseMessage = result;
}
emit(
state.copyWith(
status: ScanStatus.success,
message: StateMessage.success(
messageHandler: ResponseMessage(
ResponseString
.RESPONSE_STRING_SUCCESSFULLY_PRESENTED_YOUR_CREDENTIAL,
),
stringMessage: responseMessage,
messageHandler: responseMessage != null
? null
: ResponseMessage(
ResponseString
.RESPONSE_STRING_SUCCESSFULLY_PRESENTED_YOUR_CREDENTIAL,
),
),
),
);
Expand Down

0 comments on commit 988fffd

Please sign in to comment.