createHttpClient method Null safety

  1. @override
HttpClient createHttpClient(
  1. SecurityContext? context
)
override

Override HTTP client creation

Implementation

@override
HttpClient createHttpClient(SecurityContext? context) {
  return super.createHttpClient(context)
    ..findProxy = (uri) {
      assert(this.proxyString.isNotEmpty,
          'You must set a valid proxy if you enable it!');
      return "PROXY " + this.proxyString + ";";
    };
/*      ..badCertificateCallback = this.allowBadCertificates
        ? (X509Certificate cert, String host, int port) => true
        : null;*/
}