DioError [DioErrorType.DEFAULT]: HandshakeException: Handshake error in client (OS Error: I/flutter (28831): CERTIFICATE_VERIFY_FAILED: self signed certificate(handshake.cc:354))\ code example

Example: DioError [DioErrorType.DEFAULT]: HandshakeException: Handshake error in client (OS Error: I/flutter (28831): CERTIFICATE_VERIFY_FAILED: self signed certificate(handshake.cc:354))\

class MyHttpOverrides extends HttpOverrides{
  @override
  HttpClient createHttpClient(SecurityContext context){
    return super.createHttpClient(context)
      ..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
  }
}