0
I had that problem the other day! I solved it this way:
void main() {
HttpOverrides.global = new MyHttpOverrides();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
initialRoute: 'home',
routes: {
'home': (BuildContext context) => Login(),
},
);
}
}
class MyHttpOverrides extends HttpOverrides{
@override
HttpClient createHttpClient(SecurityContext context){
return super.createHttpClient(context)
..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
}
}
Welcome to Stack Overflow. Could you edit the question and put this error as text? Including which part of the code makes this connection would also help to get answers more easily.
– Naslausky