Reputation: 11
Running some very simple code but got this Unhandled exception which I have no idea what's going on since I'm quite new to this language.
The problem happened probably because I'm based in China. I have checked https://flutter.dev/community/china , and followed their steps. But I'm just not quite sure if everything I did was 100% right since I'm not really familiar with all the coding terminologies yet( This is just my guessing, probably this isn't the reason why I'm getting this Unhandled exception error.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.red,
body: Container(),
),
);
}
}
Unhandled exception:
Bad state: Future already completed
#0 _AsyncCompleter.complete (dart:async/future_impl.dart:39:31)
#1 _NativeSocket.startConnect.<anonymous closure>.connectNext.<anonymous closure> (dart:io-patch/socket_patch.dart:508:23)
#2 _NativeSocket.issueWriteEvent.issue (dart:io-patch/socket_patch.dart:862:14)
#3 _NativeSocket.issueWriteEvent (dart:io-patch/socket_patch.dart:869:12)
#4 _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:890:11)
#5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
Upvotes: 1
Views: 2609