@@ -34,17 +34,23 @@ final class ClientOptions {
34
34
/// Used only in case of using the default (dio) requester.
35
35
final Iterable <Interceptor >? interceptors;
36
36
37
+ /// Custom [HttpClientAdapter] used to send HTTP requests.
38
+ /// Used only in case of using the default (dio) requester.
39
+ final HttpClientAdapter ? httpClientAdapter;
40
+
37
41
/// Constructs a [ClientOptions] instance with the provided parameters.
38
- const ClientOptions (
39
- {this .connectTimeout = const Duration (seconds: 2 ),
40
- this .writeTimeout = const Duration (seconds: 30 ),
41
- this .readTimeout = const Duration (seconds: 5 ),
42
- this .hosts,
43
- this .headers,
44
- this .agentSegments,
45
- this .requester,
46
- this .logger,
47
- this .interceptors});
42
+ const ClientOptions ({
43
+ this .connectTimeout = const Duration (seconds: 2 ),
44
+ this .writeTimeout = const Duration (seconds: 30 ),
45
+ this .readTimeout = const Duration (seconds: 5 ),
46
+ this .hosts,
47
+ this .headers,
48
+ this .agentSegments,
49
+ this .requester,
50
+ this .logger,
51
+ this .interceptors,
52
+ this .httpClientAdapter,
53
+ });
48
54
49
55
@override
50
56
bool operator == (Object other) =>
@@ -59,7 +65,8 @@ final class ClientOptions {
59
65
agentSegments == other.agentSegments &&
60
66
logger == other.logger &&
61
67
requester == other.requester &&
62
- interceptors == other.interceptors;
68
+ interceptors == other.interceptors &&
69
+ httpClientAdapter == other.httpClientAdapter;
63
70
64
71
@override
65
72
int get hashCode =>
@@ -71,10 +78,11 @@ final class ClientOptions {
71
78
agentSegments.hashCode ^
72
79
logger.hashCode ^
73
80
requester.hashCode ^
74
- interceptors.hashCode;
81
+ interceptors.hashCode ^
82
+ httpClientAdapter.hashCode;
75
83
76
84
@override
77
85
String toString () {
78
- return 'ClientOptions{hosts: $hosts , connectTimeout: $connectTimeout , writeTimeout: $writeTimeout , readTimeout: $readTimeout , headers: $headers , agentSegments: $agentSegments , logger: $logger , requester: $requester , interceptors: $interceptors }' ;
86
+ return 'ClientOptions{hosts: $hosts , connectTimeout: $connectTimeout , writeTimeout: $writeTimeout , readTimeout: $readTimeout , headers: $headers , agentSegments: $agentSegments , logger: $logger , requester: $requester , interceptors: $interceptors , httpClientAdapter: $ httpClientAdapter }' ;
79
87
}
80
88
}
0 commit comments