proxy private tabs

This commit is contained in:
Fabian Freund
2025-06-23 22:05:59 +02:00
parent 9c6c50b0da
commit 9e785b7984
9 changed files with 125 additions and 14 deletions
@@ -28,12 +28,15 @@ class GeneralSettings with FastEquatable {
final Set<DeleteBrowsingDataType>? deleteBrowsingDataOnQuit;
final String defaultSearchProvider;
final bool proxyPrivateTabsTor;
GeneralSettings({
required this.themeMode,
required this.enableReadability,
required this.enforceReadability,
required this.deleteBrowsingDataOnQuit,
required this.defaultSearchProvider,
required this.proxyPrivateTabsTor,
});
GeneralSettings.withDefaults({
@@ -42,10 +45,12 @@ class GeneralSettings with FastEquatable {
bool? enforceReadability,
this.deleteBrowsingDataOnQuit,
String? defaultSearchProvider,
bool? proxyPrivateTabsTor,
}) : themeMode = themeMode ?? ThemeMode.dark,
enableReadability = enableReadability ?? true,
enforceReadability = enforceReadability ?? false,
defaultSearchProvider = defaultSearchProvider ?? 'lais';
defaultSearchProvider = defaultSearchProvider ?? 'lais',
proxyPrivateTabsTor = proxyPrivateTabsTor ?? false;
factory GeneralSettings.fromJson(Map<String, dynamic> json) =>
_$GeneralSettingsFromJson(json);
@@ -59,5 +64,6 @@ class GeneralSettings with FastEquatable {
enforceReadability,
deleteBrowsingDataOnQuit,
defaultSearchProvider,
proxyPrivateTabsTor,
];
}
@@ -19,6 +19,8 @@ abstract class _$GeneralSettingsCWProxy {
GeneralSettings defaultSearchProvider(String defaultSearchProvider);
GeneralSettings proxyPrivateTabsTor(bool proxyPrivateTabsTor);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GeneralSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
@@ -31,6 +33,7 @@ abstract class _$GeneralSettingsCWProxy {
bool enforceReadability,
Set<DeleteBrowsingDataType>? deleteBrowsingDataOnQuit,
String defaultSearchProvider,
bool proxyPrivateTabsTor,
});
}
@@ -60,6 +63,10 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
GeneralSettings defaultSearchProvider(String defaultSearchProvider) =>
this(defaultSearchProvider: defaultSearchProvider);
@override
GeneralSettings proxyPrivateTabsTor(bool proxyPrivateTabsTor) =>
this(proxyPrivateTabsTor: proxyPrivateTabsTor);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GeneralSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
@@ -73,6 +80,7 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
Object? enforceReadability = const $CopyWithPlaceholder(),
Object? deleteBrowsingDataOnQuit = const $CopyWithPlaceholder(),
Object? defaultSearchProvider = const $CopyWithPlaceholder(),
Object? proxyPrivateTabsTor = const $CopyWithPlaceholder(),
}) {
return GeneralSettings(
themeMode: themeMode == const $CopyWithPlaceholder()
@@ -97,6 +105,10 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
? _value.defaultSearchProvider
// ignore: cast_nullable_to_non_nullable
: defaultSearchProvider as String,
proxyPrivateTabsTor: proxyPrivateTabsTor == const $CopyWithPlaceholder()
? _value.proxyPrivateTabsTor
// ignore: cast_nullable_to_non_nullable
: proxyPrivateTabsTor as bool,
);
}
}
@@ -121,6 +133,7 @@ GeneralSettings _$GeneralSettingsFromJson(Map<String, dynamic> json) =>
?.map((e) => $enumDecode(_$DeleteBrowsingDataTypeEnumMap, e))
.toSet(),
defaultSearchProvider: json['defaultSearchProvider'] as String?,
proxyPrivateTabsTor: json['proxyPrivateTabsTor'] as bool?,
);
Map<String, dynamic> _$GeneralSettingsToJson(GeneralSettings instance) =>
@@ -132,6 +145,7 @@ Map<String, dynamic> _$GeneralSettingsToJson(GeneralSettings instance) =>
?.map((e) => _$DeleteBrowsingDataTypeEnumMap[e]!)
.toList(),
'defaultSearchProvider': instance.defaultSearchProvider,
'proxyPrivateTabsTor': instance.proxyPrivateTabsTor,
};
const _$ThemeModeEnumMap = {