304 lines
12 KiB
Dart
304 lines
12 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'general_settings.dart';
|
|
|
|
// **************************************************************************
|
|
// CopyWithGenerator
|
|
// **************************************************************************
|
|
|
|
abstract class _$GeneralSettingsCWProxy {
|
|
GeneralSettings themeMode(ThemeMode themeMode);
|
|
|
|
GeneralSettings enableReadability(bool enableReadability);
|
|
|
|
GeneralSettings enforceReadability(bool enforceReadability);
|
|
|
|
GeneralSettings deleteBrowsingDataOnQuit(
|
|
Set<DeleteBrowsingDataType>? deleteBrowsingDataOnQuit,
|
|
);
|
|
|
|
GeneralSettings defaultSearchProvider(String defaultSearchProvider);
|
|
|
|
GeneralSettings defaultSearchSuggestionsProvider(
|
|
SearchSuggestionProviders defaultSearchSuggestionsProvider,
|
|
);
|
|
|
|
GeneralSettings createChildTabsOption(bool createChildTabsOption);
|
|
|
|
GeneralSettings showExtensionShortcut(bool showExtensionShortcut);
|
|
|
|
GeneralSettings enableLocalAiFeatures(bool enableLocalAiFeatures);
|
|
|
|
GeneralSettings defaultCreateTabType(TabType defaultCreateTabType);
|
|
|
|
GeneralSettings defaultIntentTabType(TabType defaultIntentTabType);
|
|
|
|
GeneralSettings autoHideTabBar(bool autoHideTabBar);
|
|
|
|
GeneralSettings tabBarSwipeAction(TabBarSwipeAction tabBarSwipeAction);
|
|
|
|
/// 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
|
|
/// ```dart
|
|
/// GeneralSettings(...).copyWith(id: 12, name: "My name")
|
|
/// ````
|
|
GeneralSettings call({
|
|
ThemeMode themeMode,
|
|
bool enableReadability,
|
|
bool enforceReadability,
|
|
Set<DeleteBrowsingDataType>? deleteBrowsingDataOnQuit,
|
|
String defaultSearchProvider,
|
|
SearchSuggestionProviders defaultSearchSuggestionsProvider,
|
|
bool createChildTabsOption,
|
|
bool showExtensionShortcut,
|
|
bool enableLocalAiFeatures,
|
|
TabType defaultCreateTabType,
|
|
TabType defaultIntentTabType,
|
|
bool autoHideTabBar,
|
|
TabBarSwipeAction tabBarSwipeAction,
|
|
});
|
|
}
|
|
|
|
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGeneralSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGeneralSettings.copyWith.fieldName(...)`
|
|
class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
|
|
const _$GeneralSettingsCWProxyImpl(this._value);
|
|
|
|
final GeneralSettings _value;
|
|
|
|
@override
|
|
GeneralSettings themeMode(ThemeMode themeMode) => this(themeMode: themeMode);
|
|
|
|
@override
|
|
GeneralSettings enableReadability(bool enableReadability) =>
|
|
this(enableReadability: enableReadability);
|
|
|
|
@override
|
|
GeneralSettings enforceReadability(bool enforceReadability) =>
|
|
this(enforceReadability: enforceReadability);
|
|
|
|
@override
|
|
GeneralSettings deleteBrowsingDataOnQuit(
|
|
Set<DeleteBrowsingDataType>? deleteBrowsingDataOnQuit,
|
|
) => this(deleteBrowsingDataOnQuit: deleteBrowsingDataOnQuit);
|
|
|
|
@override
|
|
GeneralSettings defaultSearchProvider(String defaultSearchProvider) =>
|
|
this(defaultSearchProvider: defaultSearchProvider);
|
|
|
|
@override
|
|
GeneralSettings defaultSearchSuggestionsProvider(
|
|
SearchSuggestionProviders defaultSearchSuggestionsProvider,
|
|
) => this(defaultSearchSuggestionsProvider: defaultSearchSuggestionsProvider);
|
|
|
|
@override
|
|
GeneralSettings createChildTabsOption(bool createChildTabsOption) =>
|
|
this(createChildTabsOption: createChildTabsOption);
|
|
|
|
@override
|
|
GeneralSettings showExtensionShortcut(bool showExtensionShortcut) =>
|
|
this(showExtensionShortcut: showExtensionShortcut);
|
|
|
|
@override
|
|
GeneralSettings enableLocalAiFeatures(bool enableLocalAiFeatures) =>
|
|
this(enableLocalAiFeatures: enableLocalAiFeatures);
|
|
|
|
@override
|
|
GeneralSettings defaultCreateTabType(TabType defaultCreateTabType) =>
|
|
this(defaultCreateTabType: defaultCreateTabType);
|
|
|
|
@override
|
|
GeneralSettings defaultIntentTabType(TabType defaultIntentTabType) =>
|
|
this(defaultIntentTabType: defaultIntentTabType);
|
|
|
|
@override
|
|
GeneralSettings autoHideTabBar(bool autoHideTabBar) =>
|
|
this(autoHideTabBar: autoHideTabBar);
|
|
|
|
@override
|
|
GeneralSettings tabBarSwipeAction(TabBarSwipeAction tabBarSwipeAction) =>
|
|
this(tabBarSwipeAction: tabBarSwipeAction);
|
|
|
|
@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.
|
|
///
|
|
/// Usage
|
|
/// ```dart
|
|
/// GeneralSettings(...).copyWith(id: 12, name: "My name")
|
|
/// ````
|
|
GeneralSettings call({
|
|
Object? themeMode = const $CopyWithPlaceholder(),
|
|
Object? enableReadability = const $CopyWithPlaceholder(),
|
|
Object? enforceReadability = const $CopyWithPlaceholder(),
|
|
Object? deleteBrowsingDataOnQuit = const $CopyWithPlaceholder(),
|
|
Object? defaultSearchProvider = const $CopyWithPlaceholder(),
|
|
Object? defaultSearchSuggestionsProvider = const $CopyWithPlaceholder(),
|
|
Object? createChildTabsOption = const $CopyWithPlaceholder(),
|
|
Object? showExtensionShortcut = const $CopyWithPlaceholder(),
|
|
Object? enableLocalAiFeatures = const $CopyWithPlaceholder(),
|
|
Object? defaultCreateTabType = const $CopyWithPlaceholder(),
|
|
Object? defaultIntentTabType = const $CopyWithPlaceholder(),
|
|
Object? autoHideTabBar = const $CopyWithPlaceholder(),
|
|
Object? tabBarSwipeAction = const $CopyWithPlaceholder(),
|
|
}) {
|
|
return GeneralSettings(
|
|
themeMode: themeMode == const $CopyWithPlaceholder()
|
|
? _value.themeMode
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: themeMode as ThemeMode,
|
|
enableReadability: enableReadability == const $CopyWithPlaceholder()
|
|
? _value.enableReadability
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: enableReadability as bool,
|
|
enforceReadability: enforceReadability == const $CopyWithPlaceholder()
|
|
? _value.enforceReadability
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: enforceReadability as bool,
|
|
deleteBrowsingDataOnQuit:
|
|
deleteBrowsingDataOnQuit == const $CopyWithPlaceholder()
|
|
? _value.deleteBrowsingDataOnQuit
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: deleteBrowsingDataOnQuit as Set<DeleteBrowsingDataType>?,
|
|
defaultSearchProvider:
|
|
defaultSearchProvider == const $CopyWithPlaceholder()
|
|
? _value.defaultSearchProvider
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: defaultSearchProvider as String,
|
|
defaultSearchSuggestionsProvider:
|
|
defaultSearchSuggestionsProvider == const $CopyWithPlaceholder()
|
|
? _value.defaultSearchSuggestionsProvider
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: defaultSearchSuggestionsProvider as SearchSuggestionProviders,
|
|
createChildTabsOption:
|
|
createChildTabsOption == const $CopyWithPlaceholder()
|
|
? _value.createChildTabsOption
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: createChildTabsOption as bool,
|
|
showExtensionShortcut:
|
|
showExtensionShortcut == const $CopyWithPlaceholder()
|
|
? _value.showExtensionShortcut
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: showExtensionShortcut as bool,
|
|
enableLocalAiFeatures:
|
|
enableLocalAiFeatures == const $CopyWithPlaceholder()
|
|
? _value.enableLocalAiFeatures
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: enableLocalAiFeatures as bool,
|
|
defaultCreateTabType: defaultCreateTabType == const $CopyWithPlaceholder()
|
|
? _value.defaultCreateTabType
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: defaultCreateTabType as TabType,
|
|
defaultIntentTabType: defaultIntentTabType == const $CopyWithPlaceholder()
|
|
? _value.defaultIntentTabType
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: defaultIntentTabType as TabType,
|
|
autoHideTabBar: autoHideTabBar == const $CopyWithPlaceholder()
|
|
? _value.autoHideTabBar
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: autoHideTabBar as bool,
|
|
tabBarSwipeAction: tabBarSwipeAction == const $CopyWithPlaceholder()
|
|
? _value.tabBarSwipeAction
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: tabBarSwipeAction as TabBarSwipeAction,
|
|
);
|
|
}
|
|
}
|
|
|
|
extension $GeneralSettingsCopyWith on GeneralSettings {
|
|
/// Returns a callable class that can be used as follows: `instanceOfGeneralSettings.copyWith(...)` or like so:`instanceOfGeneralSettings.copyWith.fieldName(...)`.
|
|
// ignore: library_private_types_in_public_api
|
|
_$GeneralSettingsCWProxy get copyWith => _$GeneralSettingsCWProxyImpl(this);
|
|
}
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
GeneralSettings _$GeneralSettingsFromJson(Map<String, dynamic> json) =>
|
|
GeneralSettings.withDefaults(
|
|
themeMode: $enumDecodeNullable(_$ThemeModeEnumMap, json['themeMode']),
|
|
enableReadability: json['enableReadability'] as bool?,
|
|
enforceReadability: json['enforceReadability'] as bool?,
|
|
deleteBrowsingDataOnQuit:
|
|
(json['deleteBrowsingDataOnQuit'] as List<dynamic>?)
|
|
?.map((e) => $enumDecode(_$DeleteBrowsingDataTypeEnumMap, e))
|
|
.toSet(),
|
|
defaultSearchProvider: json['defaultSearchProvider'] as String?,
|
|
defaultSearchSuggestionsProvider: $enumDecodeNullable(
|
|
_$SearchSuggestionProvidersEnumMap,
|
|
json['defaultSearchSuggestionsProvider'],
|
|
),
|
|
createChildTabsOption: json['createChildTabsOption'] as bool?,
|
|
showExtensionShortcut: json['showExtensionShortcut'] as bool?,
|
|
enableLocalAiFeatures: json['enableLocalAiFeatures'] as bool?,
|
|
defaultCreateTabType: $enumDecodeNullable(
|
|
_$TabTypeEnumMap,
|
|
json['defaultCreateTabType'],
|
|
),
|
|
defaultIntentTabType: $enumDecodeNullable(
|
|
_$TabTypeEnumMap,
|
|
json['defaultIntentTabType'],
|
|
),
|
|
autoHideTabBar: json['autoHideTabBar'] as bool?,
|
|
tabBarSwipeAction: $enumDecodeNullable(
|
|
_$TabBarSwipeActionEnumMap,
|
|
json['tabBarSwipeAction'],
|
|
),
|
|
);
|
|
|
|
Map<String, dynamic> _$GeneralSettingsToJson(
|
|
GeneralSettings instance,
|
|
) => <String, dynamic>{
|
|
'themeMode': _$ThemeModeEnumMap[instance.themeMode]!,
|
|
'enableReadability': instance.enableReadability,
|
|
'enforceReadability': instance.enforceReadability,
|
|
'deleteBrowsingDataOnQuit': instance.deleteBrowsingDataOnQuit
|
|
?.map((e) => _$DeleteBrowsingDataTypeEnumMap[e]!)
|
|
.toList(),
|
|
'defaultSearchProvider': instance.defaultSearchProvider,
|
|
'defaultSearchSuggestionsProvider':
|
|
_$SearchSuggestionProvidersEnumMap[instance
|
|
.defaultSearchSuggestionsProvider]!,
|
|
'createChildTabsOption': instance.createChildTabsOption,
|
|
'showExtensionShortcut': instance.showExtensionShortcut,
|
|
'enableLocalAiFeatures': instance.enableLocalAiFeatures,
|
|
'defaultCreateTabType': _$TabTypeEnumMap[instance.defaultCreateTabType]!,
|
|
'defaultIntentTabType': _$TabTypeEnumMap[instance.defaultIntentTabType]!,
|
|
'autoHideTabBar': instance.autoHideTabBar,
|
|
'tabBarSwipeAction': _$TabBarSwipeActionEnumMap[instance.tabBarSwipeAction]!,
|
|
};
|
|
|
|
const _$ThemeModeEnumMap = {
|
|
ThemeMode.system: 'system',
|
|
ThemeMode.light: 'light',
|
|
ThemeMode.dark: 'dark',
|
|
};
|
|
|
|
const _$DeleteBrowsingDataTypeEnumMap = {
|
|
DeleteBrowsingDataType.tabs: 'tabs',
|
|
DeleteBrowsingDataType.history: 'history',
|
|
DeleteBrowsingDataType.cookies: 'cookies',
|
|
DeleteBrowsingDataType.cache: 'cache',
|
|
DeleteBrowsingDataType.permissions: 'permissions',
|
|
DeleteBrowsingDataType.downloads: 'downloads',
|
|
};
|
|
|
|
const _$SearchSuggestionProvidersEnumMap = {
|
|
SearchSuggestionProviders.none: 'none',
|
|
SearchSuggestionProviders.brave: 'brave',
|
|
SearchSuggestionProviders.ddg: 'ddg',
|
|
SearchSuggestionProviders.kagi: 'kagi',
|
|
SearchSuggestionProviders.qwant: 'qwant',
|
|
};
|
|
|
|
const _$TabTypeEnumMap = {
|
|
TabType.regular: 'regular',
|
|
TabType.private: 'private',
|
|
TabType.child: 'child',
|
|
};
|
|
|
|
const _$TabBarSwipeActionEnumMap = {
|
|
TabBarSwipeAction.switchLastOpened: 'switchLastOpened',
|
|
TabBarSwipeAction.navigateOrderedTabs: 'navigateOrderedTabs',
|
|
};
|