将 SecurityContext 更改为 SecurityContext?.
将 SecurityContext 更改为 SecurityContext?
这是更新代码:
class MyHttpOverrides extends HttpOverrides{
@override
HttpClient createHttpClient(SecurityContext? context){
return super.createHttpClient(context)
..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
}
}
HttpClient createHttpClient(SecurityContext? context) { 返回 super.createHttpClient(context) ..badCertificateCallback = (X509Certificate cert,字符串主机,int 端口)=> true }