mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-09 17:39:42 +00:00
refactor(linter): Create HTTP client from adapter
This commit is contained in:
parent
02a2097b10
commit
2ef0121321
|
@ -15,13 +15,10 @@ abstract class RestApiMap {
|
||||||
dio.interceptors.add(PrettyDioLogger());
|
dio.interceptors.add(PrettyDioLogger());
|
||||||
}
|
}
|
||||||
dio.interceptors.add(ConsoleInterceptor());
|
dio.interceptors.add(ConsoleInterceptor());
|
||||||
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
|
final adapter = dio.httpClientAdapter as IOHttpClientAdapter;
|
||||||
(final HttpClient client) {
|
final client = adapter.createHttpClient!();
|
||||||
client.badCertificateCallback =
|
client.badCertificateCallback =
|
||||||
(final X509Certificate cert, final String host, final int port) =>
|
(final X509Certificate cert, final String host, final int port) => true;
|
||||||
true;
|
|
||||||
return client;
|
|
||||||
};
|
|
||||||
|
|
||||||
dio.interceptors.add(
|
dio.interceptors.add(
|
||||||
InterceptorsWrapper(
|
InterceptorsWrapper(
|
||||||
|
|
Loading…
Reference in a new issue