Skip to content

Commit f159ff5

Browse files
committed
fix: remove the proxydetails fields from settings model
1 parent fd73721 commit f159ff5

File tree

2 files changed

+6
-51
lines changed

2 files changed

+6
-51
lines changed

lib/models/settings_model.dart

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ class SettingsModel {
1818
this.workspaceFolderPath,
1919
this.isSSLDisabled = false,
2020
this.isProxyEnabled = false,
21-
this.proxyHost = '',
22-
this.proxyPort = '',
23-
this.proxyUsername,
24-
this.proxyPassword,
2521
});
2622

2723
final bool isDark;
@@ -39,10 +35,6 @@ class SettingsModel {
3935

4036
// Proxy settings
4137
final bool isProxyEnabled;
42-
final String proxyHost;
43-
final String proxyPort;
44-
final String? proxyUsername;
45-
final String? proxyPassword;
4638

4739
SettingsModel copyWith({
4840
bool? isDark,
@@ -57,34 +49,24 @@ class SettingsModel {
5749
HistoryRetentionPeriod? historyRetentionPeriod,
5850
String? workspaceFolderPath,
5951
bool? isSSLDisabled,
60-
// Proxy settings
6152
bool? isProxyEnabled,
62-
String? proxyHost,
63-
String? proxyPort,
64-
String? proxyUsername,
65-
String? proxyPassword,
6653
}) {
6754
return SettingsModel(
6855
isDark: isDark ?? this.isDark,
6956
alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar ??
7057
this.alwaysShowCollectionPaneScrollbar,
7158
size: size ?? this.size,
59+
offset: offset ?? this.offset,
7260
defaultUriScheme: defaultUriScheme ?? this.defaultUriScheme,
7361
defaultCodeGenLang: defaultCodeGenLang ?? this.defaultCodeGenLang,
74-
offset: offset ?? this.offset,
7562
saveResponses: saveResponses ?? this.saveResponses,
7663
promptBeforeClosing: promptBeforeClosing ?? this.promptBeforeClosing,
7764
activeEnvironmentId: activeEnvironmentId ?? this.activeEnvironmentId,
7865
historyRetentionPeriod:
7966
historyRetentionPeriod ?? this.historyRetentionPeriod,
8067
workspaceFolderPath: workspaceFolderPath ?? this.workspaceFolderPath,
8168
isSSLDisabled: isSSLDisabled ?? this.isSSLDisabled,
82-
// Proxy settings
8369
isProxyEnabled: isProxyEnabled ?? this.isProxyEnabled,
84-
proxyHost: proxyHost ?? this.proxyHost,
85-
proxyPort: proxyPort ?? this.proxyPort,
86-
proxyUsername: proxyUsername ?? this.proxyUsername,
87-
proxyPassword: proxyPassword ?? this.proxyPassword,
8870
);
8971
}
9072

@@ -95,15 +77,16 @@ class SettingsModel {
9577
isDark: isDark,
9678
alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar,
9779
size: size,
80+
offset: offset,
9881
defaultUriScheme: defaultUriScheme,
9982
defaultCodeGenLang: defaultCodeGenLang,
100-
offset: offset,
10183
saveResponses: saveResponses,
10284
promptBeforeClosing: promptBeforeClosing,
10385
activeEnvironmentId: activeEnvironmentId,
10486
historyRetentionPeriod: historyRetentionPeriod,
10587
workspaceFolderPath: workspaceFolderPath,
10688
isSSLDisabled: isSSLDisabled,
89+
isProxyEnabled: isProxyEnabled,
10790
);
10891
}
10992

@@ -159,10 +142,6 @@ class SettingsModel {
159142
final workspaceFolderPath = data["workspaceFolderPath"] as String?;
160143
final isSSLDisabled = data["isSSLDisabled"] as bool?;
161144
final isProxyEnabled = data["isProxyEnabled"] as bool?;
162-
final proxyHost = data["proxyHost"] as String?;
163-
final proxyPort = data["proxyPort"] as String?;
164-
final proxyUsername = data["proxyUsername"] as String?;
165-
final proxyPassword = data["proxyPassword"] as String?;
166145

167146
const sm = SettingsModel();
168147

@@ -181,10 +160,6 @@ class SettingsModel {
181160
workspaceFolderPath: workspaceFolderPath,
182161
isSSLDisabled: isSSLDisabled,
183162
isProxyEnabled: isProxyEnabled,
184-
proxyHost: proxyHost,
185-
proxyPort: proxyPort,
186-
proxyUsername: proxyUsername,
187-
proxyPassword: proxyPassword,
188163
);
189164
}
190165

@@ -204,12 +179,7 @@ class SettingsModel {
204179
"historyRetentionPeriod": historyRetentionPeriod.name,
205180
"workspaceFolderPath": workspaceFolderPath,
206181
"isSSLDisabled": isSSLDisabled,
207-
// Proxy settings
208182
"isProxyEnabled": isProxyEnabled,
209-
"proxyHost": proxyHost,
210-
"proxyPort": proxyPort,
211-
"proxyUsername": proxyUsername,
212-
"proxyPassword": proxyPassword,
213183
};
214184
}
215185

@@ -235,11 +205,7 @@ class SettingsModel {
235205
other.historyRetentionPeriod == historyRetentionPeriod &&
236206
other.workspaceFolderPath == workspaceFolderPath &&
237207
other.isSSLDisabled == isSSLDisabled &&
238-
other.isProxyEnabled == isProxyEnabled &&
239-
other.proxyHost == proxyHost &&
240-
other.proxyPort == proxyPort &&
241-
other.proxyUsername == proxyUsername &&
242-
other.proxyPassword == proxyPassword;
208+
other.isProxyEnabled == isProxyEnabled;
243209
}
244210

245211
@override
@@ -259,10 +225,6 @@ class SettingsModel {
259225
workspaceFolderPath,
260226
isSSLDisabled,
261227
isProxyEnabled,
262-
proxyHost,
263-
proxyPort,
264-
proxyUsername,
265-
proxyPassword,
266228
);
267229
}
268230
}

packages/apidash_core/lib/services/http_service.dart

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,13 @@ Future<(HttpResponse?, Duration?, String?)> sendHttpRequest(
1818
HttpRequestModel requestModel, {
1919
SupportedUriSchemes defaultUriScheme = kDefaultUriScheme,
2020
bool noSSL = false,
21-
bool? isProxyEnabled,
22-
String? proxyHost,
23-
String? proxyPort,
24-
String? proxyUsername,
25-
String? proxyPassword,
21+
ProxySettings? proxySettings,
2622
}) async {
2723
final clientManager = HttpClientManager();
2824
final client = clientManager.createClient(
2925
requestId,
3026
noSSL: noSSL,
31-
proxyHost: isProxyEnabled == true ? proxyHost : null,
32-
proxyPort: isProxyEnabled == true ? proxyPort : null,
33-
proxyUsername: isProxyEnabled == true ? proxyUsername : null,
34-
proxyPassword: isProxyEnabled == true ? proxyPassword : null,
27+
proxySettings: proxySettings,
3528
);
3629

3730
(Uri?, String?) uriRec = getValidRequestUri(

0 commit comments

Comments
 (0)