@@ -17,7 +17,7 @@ class SettingsModel {
1717 this .historyRetentionPeriod = HistoryRetentionPeriod .oneWeek,
1818 this .workspaceFolderPath,
1919 this .isSSLDisabled = false ,
20- this .isProxyEnabled = false ,
20+ this .proxySettings = const ProxySettings () ,
2121 });
2222
2323 final bool isDark;
@@ -34,7 +34,7 @@ class SettingsModel {
3434 final bool isSSLDisabled;
3535
3636 // Proxy settings
37- final bool isProxyEnabled ;
37+ final ProxySettings proxySettings ;
3838
3939 SettingsModel copyWith ({
4040 bool ? isDark,
@@ -49,7 +49,7 @@ class SettingsModel {
4949 HistoryRetentionPeriod ? historyRetentionPeriod,
5050 String ? workspaceFolderPath,
5151 bool ? isSSLDisabled,
52- bool ? isProxyEnabled ,
52+ ProxySettings ? proxySettings ,
5353 }) {
5454 return SettingsModel (
5555 isDark: isDark ?? this .isDark,
@@ -66,7 +66,7 @@ class SettingsModel {
6666 historyRetentionPeriod ?? this .historyRetentionPeriod,
6767 workspaceFolderPath: workspaceFolderPath ?? this .workspaceFolderPath,
6868 isSSLDisabled: isSSLDisabled ?? this .isSSLDisabled,
69- isProxyEnabled : isProxyEnabled ?? this .isProxyEnabled ,
69+ proxySettings : proxySettings ?? this .proxySettings ,
7070 );
7171 }
7272
@@ -86,7 +86,7 @@ class SettingsModel {
8686 historyRetentionPeriod: historyRetentionPeriod,
8787 workspaceFolderPath: workspaceFolderPath,
8888 isSSLDisabled: isSSLDisabled,
89- isProxyEnabled : isProxyEnabled ,
89+ proxySettings : proxySettings ,
9090 );
9191 }
9292
@@ -141,7 +141,6 @@ class SettingsModel {
141141 }
142142 final workspaceFolderPath = data["workspaceFolderPath" ] as String ? ;
143143 final isSSLDisabled = data["isSSLDisabled" ] as bool ? ;
144- final isProxyEnabled = data["isProxyEnabled" ] as bool ? ;
145144
146145 const sm = SettingsModel ();
147146
@@ -159,7 +158,7 @@ class SettingsModel {
159158 historyRetentionPeriod ?? HistoryRetentionPeriod .oneWeek,
160159 workspaceFolderPath: workspaceFolderPath,
161160 isSSLDisabled: isSSLDisabled,
162- isProxyEnabled : isProxyEnabled ,
161+ proxySettings : ProxySettings . fromJson (data[ "proxySettings" ]) ,
163162 );
164163 }
165164
@@ -179,7 +178,7 @@ class SettingsModel {
179178 "historyRetentionPeriod" : historyRetentionPeriod.name,
180179 "workspaceFolderPath" : workspaceFolderPath,
181180 "isSSLDisabled" : isSSLDisabled,
182- "isProxyEnabled " : isProxyEnabled ,
181+ "proxySettings " : proxySettings ,
183182 };
184183 }
185184
@@ -205,7 +204,7 @@ class SettingsModel {
205204 other.historyRetentionPeriod == historyRetentionPeriod &&
206205 other.workspaceFolderPath == workspaceFolderPath &&
207206 other.isSSLDisabled == isSSLDisabled &&
208- other.isProxyEnabled == isProxyEnabled ;
207+ other.proxySettings == proxySettings ;
209208 }
210209
211210 @override
@@ -224,7 +223,7 @@ class SettingsModel {
224223 historyRetentionPeriod,
225224 workspaceFolderPath,
226225 isSSLDisabled,
227- isProxyEnabled ,
226+ proxySettings ,
228227 );
229228 }
230229}
0 commit comments