Skip to content

Commit 107a17c

Browse files
committed
chore: saving of proxy settings
1 parent 438a558 commit 107a17c

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

lib/models/settings_model.dart

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ class SettingsModel {
7979
historyRetentionPeriod ?? this.historyRetentionPeriod,
8080
workspaceFolderPath: workspaceFolderPath ?? this.workspaceFolderPath,
8181
isSSLDisabled: isSSLDisabled ?? this.isSSLDisabled,
82+
// Proxy settings
83+
isProxyEnabled: isProxyEnabled ?? this.isProxyEnabled,
84+
proxyHost: proxyHost ?? this.proxyHost,
85+
proxyPort: proxyPort ?? this.proxyPort,
86+
proxyUsername: proxyUsername ?? this.proxyUsername,
87+
proxyPassword: proxyPassword ?? this.proxyPassword,
8288
);
8389
}
8490

@@ -152,6 +158,11 @@ class SettingsModel {
152158
}
153159
final workspaceFolderPath = data["workspaceFolderPath"] as String?;
154160
final isSSLDisabled = data["isSSLDisabled"] as bool?;
161+
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?;
155166

156167
const sm = SettingsModel();
157168

@@ -169,6 +180,11 @@ class SettingsModel {
169180
historyRetentionPeriod ?? HistoryRetentionPeriod.oneWeek,
170181
workspaceFolderPath: workspaceFolderPath,
171182
isSSLDisabled: isSSLDisabled,
183+
isProxyEnabled: isProxyEnabled,
184+
proxyHost: proxyHost,
185+
proxyPort: proxyPort,
186+
proxyUsername: proxyUsername,
187+
proxyPassword: proxyPassword,
172188
);
173189
}
174190

@@ -188,6 +204,12 @@ class SettingsModel {
188204
"historyRetentionPeriod": historyRetentionPeriod.name,
189205
"workspaceFolderPath": workspaceFolderPath,
190206
"isSSLDisabled": isSSLDisabled,
207+
// Proxy settings
208+
"isProxyEnabled": isProxyEnabled,
209+
"proxyHost": proxyHost,
210+
"proxyPort": proxyPort,
211+
"proxyUsername": proxyUsername,
212+
"proxyPassword": proxyPassword,
191213
};
192214
}
193215

@@ -212,7 +234,12 @@ class SettingsModel {
212234
other.activeEnvironmentId == activeEnvironmentId &&
213235
other.historyRetentionPeriod == historyRetentionPeriod &&
214236
other.workspaceFolderPath == workspaceFolderPath &&
215-
other.isSSLDisabled == isSSLDisabled;
237+
other.isSSLDisabled == isSSLDisabled &&
238+
other.isProxyEnabled == isProxyEnabled &&
239+
other.proxyHost == proxyHost &&
240+
other.proxyPort == proxyPort &&
241+
other.proxyUsername == proxyUsername &&
242+
other.proxyPassword == proxyPassword;
216243
}
217244

218245
@override
@@ -231,6 +258,11 @@ class SettingsModel {
231258
historyRetentionPeriod,
232259
workspaceFolderPath,
233260
isSSLDisabled,
261+
isProxyEnabled,
262+
proxyHost,
263+
proxyPort,
264+
proxyUsername,
265+
proxyPassword,
234266
);
235267
}
236268
}

0 commit comments

Comments
 (0)