feat: Unp4kcState errorMessage

This commit is contained in:
2024-05-05 16:47:42 +08:00
parent 8d2b4983c0
commit 3e5a258cf8
7 changed files with 259 additions and 223 deletions

View File

@ -29,6 +29,7 @@ class Unp4kcState with _$Unp4kcState {
required String curPath,
String? endMessage,
MapEntry<String, String>? tempOpenFile,
@Default("") String errorMessage,
}) = _Unp4kcState;
}
@ -72,6 +73,12 @@ class Unp4kCModel extends _$Unp4kCModel {
break;
case RsProcessStreamDataType.error:
dPrint("[unp4kc] stderr: ${event.data}");
if (state.errorMessage.isEmpty) {
state = state.copyWith(errorMessage: event.data);
} else {
state = state.copyWith(
errorMessage: "${state.errorMessage}\n${event.data}");
}
break;
case RsProcessStreamDataType.exit:
dPrint("[unp4kc] exit: ${event.data}");