Bad state: Future already completed
See original GitHub issueDescribe the bug Every flutter command I try to run I get the following exception:
Bad state: Future already completed
#0 _AsyncCompleter.complete (dart:async/future_impl.dart:43:31)
#1 _NativeSocket.startConnect.<anonymous closure>.connectNext.<anonymous closure> (dart:io-patch/socket_patch.dart:682:23)
#2 _NativeSocket.issueWriteEvent.issue (dart:io-patch/socket_patch.dart:1102:14)
#3 _NativeSocket.issueWriteEvent (dart:io-patch/socket_patch.dart:1109:12)
#4 _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:1130:11)
#5 …
Inside vscode if I click on run to launch the flutter project, also get the same error as this issue.
To Reproduce Steps to reproduce the behavior: Unclear, first time I have it, Installed 2 days ago, could use it 2 days in a row, while putting my pc to sleep inbetween, today after a whole day of working on other things in vscode, this happened.
Expected behavior I expect it to run without error
Screenshots
Versions (please complete the following information):
- VS Code version: 1.51.1
- Dart extension version: 3.16.0
- Dart/Flutter SDK version: 2.10.4/1.22.4
- OSX: 11.0.1 (20B50)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Bad state: Future already completed · Issue #71483 - GitHub
Every flutter command I try to run I get the following exception: Bad state: Future already completed #0 _AsyncCompleter.complete (dart:async/ ...
Read more >Future already completed in flutter listview and Video player ...
Looks like you're trying to change the state during the UI build, be sure you're not using setState(...) in ListView.builder(...).
Read more >A network extension breaks the Flutter package manager
Bad state : Future already completed ... But the dart have closed connection already and completion handler of [NEAppProxyFlow ...
Read more >Unhandled Exception: Bad state: Future already completed in ...
In Demo, First Screen click button go to Second screen. You do not need Navigator.pop(context); Just Navigator.pushReplacementNamed(context, '/second'); will ...
Read more >Fix bug "Bad state: Future already completed" - Flutter
I am writing a simple flutter application, it does not have much functionality yet but one FutureBuilder component is giving me a problem...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, glad to hear you solved it!
In that case, this seems like an issue in Flutter that will need solving there, not here in the VS Code extension. It would be best raised at https://github.com/flutter/flutter/.
Before you do - if you have
git
it may be worth runninggit status
inside your Flutter SDK folder, just to check you haven’t got any corrupt files (I’ve seen some people end up with badly-merged files after a Flutter upgrade). You can post the output of that here if you’re not sure how to interpret it.Thanks!