fix formatting

This commit is contained in:
Fabian Freund
2026-01-13 18:08:23 +01:00
parent 33e3fdd111
commit fa6878d2b2
22 changed files with 243 additions and 321 deletions
@@ -51,17 +51,17 @@ class AdvancedSettingsScreen extends StatelessWidget {
child: FadingScroll(
fadingSize: 25,
builder: (context, controller) {
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_ContentBehaviorSection(),
_StorageDebuggingSection(),
_ResetSection(),
],
);
},
),
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_ContentBehaviorSection(),
_StorageDebuggingSection(),
_ResetSection(),
],
);
},
),
),
);
}
@@ -119,9 +119,7 @@ class _JavaScriptTile extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final javascriptEnabled = ref.watch(
engineSettingsWithDefaultsProvider.select(
(s) => s.javascriptEnabled,
),
engineSettingsWithDefaultsProvider.select((s) => s.javascriptEnabled),
);
return SwitchListTile.adaptive(
@@ -111,10 +111,7 @@ class _ThemeSection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -146,9 +143,7 @@ class _ThemeSection extends HookConsumerWidget {
selected: {themeMode},
onSelectionChanged: (value) async {
await ref
.read(
saveGeneralSettingsControllerProvider.notifier,
)
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.themeMode(value.first),
@@ -172,10 +167,7 @@ class _TabBarPositionSection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -190,9 +182,7 @@ class _TabBarPositionSection extends HookConsumerWidget {
onChanged: (value) async {
if (value != null) {
await ref
.read(
saveGeneralSettingsControllerProvider.notifier,
)
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.tabBarPosition(value),
@@ -204,9 +194,7 @@ class _TabBarPositionSection extends HookConsumerWidget {
RadioListTile.adaptive(
value: TabBarPosition.top,
title: Text('Top'),
subtitle: Text(
'Persistent tab bar without auto-hide',
),
subtitle: Text('Persistent tab bar without auto-hide'),
),
RadioListTile.adaptive(
value: TabBarPosition.bottom,
@@ -228,8 +216,9 @@ class _ShowContextualTabBarTile extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final tabBarShowContextualBar = ref.watch(
generalSettingsWithDefaultsProvider
.select((s) => s.tabBarShowContextualBar),
generalSettingsWithDefaultsProvider.select(
(s) => s.tabBarShowContextualBar,
),
);
return SwitchListTile.adaptive(
@@ -257,8 +246,9 @@ class _ShowQuickTabSwitcherBarTile extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final tabBarShowQuickTabSwitcherBar = ref.watch(
generalSettingsWithDefaultsProvider
.select((s) => s.tabBarShowQuickTabSwitcherBar),
generalSettingsWithDefaultsProvider.select(
(s) => s.tabBarShowQuickTabSwitcherBar,
),
);
return SwitchListTile.adaptive(
@@ -272,8 +262,8 @@ class _ShowQuickTabSwitcherBarTile extends HookConsumerWidget {
await ref
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) => currentSettings.copyWith
.tabBarShowQuickTabSwitcherBar(value),
(currentSettings) =>
currentSettings.copyWith.tabBarShowQuickTabSwitcherBar(value),
);
},
);
@@ -290,10 +280,7 @@ class _QuickTabSwitcherModeSection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -308,12 +295,10 @@ class _QuickTabSwitcherModeSection extends HookConsumerWidget {
onChanged: (value) async {
if (value != null) {
await ref
.read(
saveGeneralSettingsControllerProvider.notifier,
)
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) => currentSettings.copyWith
.quickTabSwitcherMode(value),
(currentSettings) =>
currentSettings.copyWith.quickTabSwitcherMode(value),
);
}
},
@@ -322,16 +307,12 @@ class _QuickTabSwitcherModeSection extends HookConsumerWidget {
RadioListTile.adaptive(
value: QuickTabSwitcherMode.lastUsedTabs,
title: Text('Recently Used Tabs'),
subtitle: Text(
'Recently used tabs across all containers',
),
subtitle: Text('Recently used tabs across all containers'),
),
RadioListTile.adaptive(
value: QuickTabSwitcherMode.containerTabs,
title: Text('Container Tabs'),
subtitle: Text(
'Ordered tabs of the selected container',
),
subtitle: Text('Ordered tabs of the selected container'),
),
],
),
@@ -34,17 +34,17 @@ class FingerprintingSettingsScreen extends StatelessWidget {
child: FadingScroll(
fadingSize: 25,
builder: (context, controller) {
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_MainProtectionSection(),
_IdentitySection(),
_AdvancedSection(),
],
);
},
),
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_MainProtectionSection(),
_IdentitySection(),
_AdvancedSection(),
],
);
},
),
),
);
}
@@ -120,9 +120,7 @@ class _FingerprintProtectionTile extends StatelessWidget {
Widget build(BuildContext context) {
return ListTile(
title: const Text('Fingerprint Protection'),
subtitle: const Text(
'Granular control over browser fingerprinting',
),
subtitle: const Text('Granular control over browser fingerprinting'),
contentPadding: const EdgeInsets.symmetric(
vertical: 8.0,
horizontal: 16.0,
@@ -143,9 +141,7 @@ class _ResistFingerprintingTile extends StatelessWidget {
Widget build(BuildContext context) {
return ListTile(
title: const Text('Resist Fingerprinting'),
subtitle: const Text(
'Advanced fingerprinting protection hardening',
),
subtitle: const Text('Advanced fingerprinting protection hardening'),
contentPadding: const EdgeInsets.symmetric(
vertical: 8.0,
horizontal: 16.0,
@@ -43,19 +43,19 @@ class PrivacySecuritySettingsScreen extends StatelessWidget {
child: FadingScroll(
fadingSize: 25,
builder: (context, controller) {
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_PrivacyModesSection(),
_TrackingProtectionSection(),
_ConnectionSecuritySection(),
_DataManagementSection(),
_AdvancedSection(),
],
);
},
),
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_PrivacyModesSection(),
_TrackingProtectionSection(),
_ConnectionSecuritySection(),
_DataManagementSection(),
_AdvancedSection(),
],
);
},
),
),
);
}
@@ -161,19 +161,13 @@ class _IncognitoModeSection extends HookConsumerWidget {
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) => value
? currentSettings.copyWith.deleteBrowsingDataOnQuit(
{},
)
: currentSettings.copyWith.deleteBrowsingDataOnQuit(
null,
),
? currentSettings.copyWith.deleteBrowsingDataOnQuit({})
: currentSettings.copyWith.deleteBrowsingDataOnQuit(null),
);
},
),
if (deleteBrowsingDataOnQuit != null)
_DeleteBrowsingDataTypes(
selectedTypes: deleteBrowsingDataOnQuit,
),
_DeleteBrowsingDataTypes(selectedTypes: deleteBrowsingDataOnQuit),
],
);
}
@@ -187,10 +181,7 @@ class _DeleteBrowsingDataTypes extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
children: [
for (final type in DeleteBrowsingDataType.values)
@@ -208,20 +199,19 @@ class _DeleteBrowsingDataTypes extends HookConsumerWidget {
if (value == true) {
await notifier.save(
(currentSettings) => currentSettings.copyWith
.deleteBrowsingDataOnQuit({
...currentSettings.deleteBrowsingDataOnQuit!,
type,
}),
(currentSettings) =>
currentSettings.copyWith.deleteBrowsingDataOnQuit({
...currentSettings.deleteBrowsingDataOnQuit!,
type,
}),
);
} else {
await notifier.save(
(currentSettings) => currentSettings.copyWith
.deleteBrowsingDataOnQuit(
{
...currentSettings.deleteBrowsingDataOnQuit!,
}..remove(type),
),
(currentSettings) =>
currentSettings.copyWith.deleteBrowsingDataOnQuit(
{...currentSettings.deleteBrowsingDataOnQuit!}
..remove(type),
),
);
}
},
@@ -269,10 +259,7 @@ class _AutoClearHistorySection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -296,41 +283,19 @@ class _AutoClearHistorySection extends HookConsumerWidget {
),
width: double.infinity,
dropdownMenuEntries: const [
DropdownMenuEntry(
value: Duration.zero,
label: 'Never',
),
DropdownMenuEntry(
value: Duration(days: 1),
label: '1 Day',
),
DropdownMenuEntry(
value: Duration(days: 7),
label: '1 Week',
),
DropdownMenuEntry(
value: Duration(days: 14),
label: '2 Weeks',
),
DropdownMenuEntry(
value: Duration(days: 30),
label: '1 Month',
),
DropdownMenuEntry(
value: Duration(days: 90),
label: '3 Months',
),
DropdownMenuEntry(value: Duration.zero, label: 'Never'),
DropdownMenuEntry(value: Duration(days: 1), label: '1 Day'),
DropdownMenuEntry(value: Duration(days: 7), label: '1 Week'),
DropdownMenuEntry(value: Duration(days: 14), label: '2 Weeks'),
DropdownMenuEntry(value: Duration(days: 30), label: '1 Month'),
DropdownMenuEntry(value: Duration(days: 90), label: '3 Months'),
],
onSelected: (value) async {
await ref
.read(
saveGeneralSettingsControllerProvider.notifier,
)
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) => currentSettings.copyWith
.historyAutoCleanInterval(
value ?? Duration.zero,
),
.historyAutoCleanInterval(value ?? Duration.zero),
);
},
),
@@ -378,10 +343,7 @@ class _HttpsOnlyModeSection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -410,9 +372,7 @@ class _HttpsOnlyModeSection extends HookConsumerWidget {
selected: {httpsOnlyMode},
onSelectionChanged: (value) async {
await ref
.read(
saveEngineSettingsControllerProvider.notifier,
)
.read(saveEngineSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.httpsOnlyMode(value.first),
@@ -458,10 +418,7 @@ class _EnhancedTrackingProtectionSection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -477,8 +434,8 @@ class _EnhancedTrackingProtectionSection extends HookConsumerWidget {
await ref
.read(saveEngineSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.trackingProtectionPolicy(value),
(currentSettings) => currentSettings.copyWith
.trackingProtectionPolicy(value),
);
},
child: const Column(
@@ -504,9 +461,7 @@ class _EnhancedTrackingProtectionSection extends HookConsumerWidget {
RadioListTile<TrackingProtectionPolicy>.adaptive(
value: TrackingProtectionPolicy.custom,
title: Text('Custom'),
subtitle: Text(
'Choose which trackers and scripts to block.',
),
subtitle: Text('Choose which trackers and scripts to block.'),
),
],
),
@@ -546,8 +501,8 @@ class _BounceTrackingProtectionTile extends HookConsumerWidget {
await ref
.read(saveEngineSettingsControllerProvider.notifier)
.save(
(currentSettings) => currentSettings.copyWith
.bounceTrackingProtectionMode(
(currentSettings) =>
currentSettings.copyWith.bounceTrackingProtectionMode(
value
? BounceTrackingProtectionMode.enabled
: BounceTrackingProtectionMode.disabled,
@@ -570,10 +525,7 @@ class _QueryParameterStrippingSection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -605,12 +557,10 @@ class _QueryParameterStrippingSection extends HookConsumerWidget {
selected: {queryParameterStripping},
onSelectionChanged: (value) async {
await ref
.read(
saveEngineSettingsControllerProvider.notifier,
)
.read(saveEngineSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.queryParameterStripping(value.first),
(currentSettings) => currentSettings.copyWith
.queryParameterStripping(value.first),
);
},
),
@@ -44,18 +44,18 @@ class SearchContentSettingsScreen extends StatelessWidget {
child: FadingScroll(
fadingSize: 25,
builder: (context, controller) {
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_SearchSection(),
_ContentViewingSection(),
_ContentEnhancementSection(),
_ExtensionsSection(),
],
);
},
),
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_SearchSection(),
_ContentViewingSection(),
_ContentEnhancementSection(),
_ExtensionsSection(),
],
);
},
),
),
);
}
@@ -154,16 +154,14 @@ class _AutocompleteProviderSection extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final defaultSearchSuggestionsProvider = ref.watch(
generalSettingsWithDefaultsProvider
.select((s) => s.defaultSearchSuggestionsProvider),
generalSettingsWithDefaultsProvider.select(
(s) => s.defaultSearchSuggestionsProvider,
),
);
final relatedBang = defaultSearchSuggestionsProvider.relatedBang;
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -183,28 +181,27 @@ class _AutocompleteProviderSection extends HookConsumerWidget {
),
),
width: double.infinity,
leadingIcon:
relatedBang.mapNotNull((trigger) => BangIcon(trigger: trigger)),
dropdownMenuEntries: SearchSuggestionProviders.values
.map((provider) {
return DropdownMenuEntry(
value: provider,
label: provider.label,
leadingIcon: provider.relatedBang.mapNotNull(
(trigger) => BangIcon(trigger: trigger),
),
);
})
.toList(),
leadingIcon: relatedBang.mapNotNull(
(trigger) => BangIcon(trigger: trigger),
),
dropdownMenuEntries: SearchSuggestionProviders.values.map((
provider,
) {
return DropdownMenuEntry(
value: provider,
label: provider.label,
leadingIcon: provider.relatedBang.mapNotNull(
(trigger) => BangIcon(trigger: trigger),
),
);
}).toList(),
onSelected: (value) async {
if (value != null) {
await ref
.read(
saveGeneralSettingsControllerProvider.notifier,
)
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.defaultSearchSuggestionsProvider(value),
(currentSettings) => currentSettings.copyWith
.defaultSearchSuggestionsProvider(value),
);
}
},
@@ -243,7 +240,9 @@ class _OnDeviceAiTile extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final enableLocalAiFeatures = ref.watch(
generalSettingsWithDefaultsProvider.select((s) => s.enableLocalAiFeatures),
generalSettingsWithDefaultsProvider.select(
(s) => s.enableLocalAiFeatures,
),
);
return SwitchListTile.adaptive(
@@ -315,9 +314,7 @@ class _EnforceReaderModeTile extends HookConsumerWidget {
onChanged: enableReadability
? (value) async {
await ref
.read(
saveGeneralSettingsControllerProvider.notifier,
)
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.enforceReadability(value),
@@ -39,17 +39,17 @@ class TabsBehaviorSettingsScreen extends StatelessWidget {
child: FadingScroll(
fadingSize: 25,
builder: (context, controller) {
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_TabCreationSection(),
_TabOrganizationSection(),
_TabInteractionSection(),
],
);
},
),
return ListView(
controller: controller,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
children: const [
_TabCreationSection(),
_TabOrganizationSection(),
_TabInteractionSection(),
],
);
},
),
),
);
}
@@ -110,19 +110,14 @@ class _NewTabDefaultSection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const ListTile(
title: Text('New Tab Default'),
subtitle: Text(
'Choose the default type for manually created tabs',
),
subtitle: Text('Choose the default type for manually created tabs'),
leading: Icon(MdiIcons.tab),
contentPadding: EdgeInsets.zero,
),
@@ -144,12 +139,10 @@ class _NewTabDefaultSection extends HookConsumerWidget {
selected: {defaultCreateTabType},
onSelectionChanged: (value) async {
await ref
.read(
saveGeneralSettingsControllerProvider.notifier,
)
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.defaultCreateTabType(value.first),
(currentSettings) => currentSettings.copyWith
.defaultCreateTabType(value.first),
);
},
style: switch (defaultCreateTabType) {
@@ -178,19 +171,14 @@ class _ExternalLinkHandlingSection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const ListTile(
title: Text('External Link Handling'),
subtitle: Text(
'Choose how external links open in WebLibre',
),
subtitle: Text('Choose how external links open in WebLibre'),
leading: Icon(MdiIcons.tabPlus),
contentPadding: EdgeInsets.zero,
),
@@ -217,12 +205,10 @@ class _ExternalLinkHandlingSection extends HookConsumerWidget {
selected: {tabIntentOpenSetting},
onSelectionChanged: (value) async {
await ref
.read(
saveGeneralSettingsControllerProvider.notifier,
)
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.tabIntentOpenSetting(value.first),
(currentSettings) => currentSettings.copyWith
.tabIntentOpenSetting(value.first),
);
},
style: switch (tabIntentOpenSetting) {
@@ -246,7 +232,9 @@ class _CreateChildTabsTile extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final createChildTabsOption = ref.watch(
generalSettingsWithDefaultsProvider.select((s) => s.createChildTabsOption),
generalSettingsWithDefaultsProvider.select(
(s) => s.createChildTabsOption,
),
);
return SwitchListTile.adaptive(
@@ -274,14 +262,14 @@ class _ShowExtensionShortcutTile extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final showExtensionShortcut = ref.watch(
generalSettingsWithDefaultsProvider.select((s) => s.showExtensionShortcut),
generalSettingsWithDefaultsProvider.select(
(s) => s.showExtensionShortcut,
),
);
return SwitchListTile.adaptive(
title: const Text('Show Extension Shortcut'),
subtitle: const Text(
'Display an extension menu directly on the tab bar',
),
subtitle: const Text('Display an extension menu directly on the tab bar'),
secondary: const Icon(MdiIcons.puzzleHeart),
value: showExtensionShortcut,
onChanged: (value) async {
@@ -306,10 +294,7 @@ class _TabBarSwipeBehaviorSection extends HookConsumerWidget {
);
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -324,9 +309,7 @@ class _TabBarSwipeBehaviorSection extends HookConsumerWidget {
onChanged: (value) async {
if (value != null) {
await ref
.read(
saveGeneralSettingsControllerProvider.notifier,
)
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.tabBarSwipeAction(value),