我有一些看起来像这样的代码的问题。在这个表格中我有一个错误
The expression here has a type of 'void', and therefore can't be used.
Try checking to see if you're using the correct API; there might be a function or call that returns void you didn't expect. Also check type parameters and variables which might also be void.dart(use_of_void_result)
.
如果我删除 .onDone() 错误就会消失。为什么?请 ELI5 :-) 我正在查看https://api.dart.dev/stable/2.7.0/dart-async/Stream/listen.html但似乎仍然误解了一些东西。我还阅读了https://api.dart.dev/stable/2.7.0/dart-async/StreamSubscription/onDone.html
serviceName.UploadThing(uploadRequest).listen((response) {
uploadMessageOutput = response.message;
if (response.uploadResult) {
showSuccess();
} else {
showError();
}
getUploadFileList(event);
isSaveInProgress = false;
}).onError((error) {
isSaveInProgress = …
Run Code Online (Sandbox Code Playgroud) dart ×1