We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dart
var aaaa= false; Future likeMomentsOne(workMomentID,index) { ///send your request here
aaaa=!aaaa; final Completer<bool> completer = new Completer<bool>(); completer.complete(aaaa); aaaa=!aaaa; await Timer(const Duration(milliseconds: 500), () { print("dddll"); // if your request is failed,return null, completer.complete(aaaa); }); return completer.future;
}
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Future already completed #0 _AsyncCompleter.complete (dart:async/future_impl.dart:41:31)[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Future already completed #0 _AsyncCompleter.complete (dart:async/future_impl.dart:41:31)
No response
The text was updated successfully, but these errors were encountered:
Future already completed
Completer 不是stream,不能多次调用complete
Sorry, something went wrong.
No branches or pull requests
Platforms
dart
Description
var aaaa= false;
Future likeMomentsOne(workMomentID,index) {
///send your request here
}
My code
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Future already completed
#0 _AsyncCompleter.complete (dart:async/future_impl.dart:41:31)[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Future already completed
#0 _AsyncCompleter.complete (dart:async/future_impl.dart:41:31)
Try do it
No response
The text was updated successfully, but these errors were encountered: