- Replace all instances of
HttpClientWithInterceptorwithInterceptedClient.
- Replace all instances of
HttpWithInterceptorwithInterceptedHttp.
Since the badCertificatesCallback can only be set for HttpClient which is part of the dart:io package, removing the built-in property was necessary in order to support Flutter Web.
You can still achieve support for self-signed certificates by providing InterceptedHttp or InterceptedClient with the client parameter when using the build method on either of those, it should look something like this:
Client client = InterceptedClient.build(
interceptors: [
WeatherApiInterceptor(),
],
client: IOClient(
HttpClient()
..badCertificateCallback = badCertificateCallback
..findProxy = findProxy,
);
);final http = InterceptedHttp.build(
interceptors: [
WeatherApiInterceptor(),
],
client: IOClient(
HttpClient()
..badCertificateCallback = badCertificateCallback
..findProxy = findProxy,
);
);