getHttpClient static method

HttpClient getHttpClient({
  1. Duration? duration,
})

Implementation

static HttpClient getHttpClient({Duration? duration}) {
  HttpClient httpClient = HttpClient()
    ..connectionTimeout = duration ?? const Duration(seconds: 120)
    ..badCertificateCallback = ((X509Certificate cert, String host, int port) => trustSelfSigned);

  return httpClient;
}