upgrade min sdk; run formatter
This commit is contained in:
@@ -118,19 +118,18 @@ class GeneralSettingsScreen extends HookConsumerWidget {
|
||||
value:
|
||||
generalSettings.enableReadability &&
|
||||
generalSettings.enforceReadability,
|
||||
onChanged:
|
||||
generalSettings.enableReadability
|
||||
? (value) async {
|
||||
await ref
|
||||
.read(
|
||||
saveGeneralSettingsControllerProvider.notifier,
|
||||
)
|
||||
.save(
|
||||
(currentSettings) => currentSettings.copyWith
|
||||
.enforceReadability(value),
|
||||
);
|
||||
}
|
||||
: null,
|
||||
onChanged: generalSettings.enableReadability
|
||||
? (value) async {
|
||||
await ref
|
||||
.read(
|
||||
saveGeneralSettingsControllerProvider.notifier,
|
||||
)
|
||||
.save(
|
||||
(currentSettings) => currentSettings.copyWith
|
||||
.enforceReadability(value),
|
||||
);
|
||||
}
|
||||
: null,
|
||||
),
|
||||
Consumer(
|
||||
builder: (context, ref, child) {
|
||||
|
||||
@@ -69,47 +69,44 @@ class WebEngineHardeningScreen extends HookConsumerWidget {
|
||||
),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children:
|
||||
data.entries.map((group) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ListTile(
|
||||
title: Text(group.key),
|
||||
subtitle: group.value.description.mapNotNull(
|
||||
(description) => Text(description),
|
||||
),
|
||||
leading: HardeningGroupIcon(
|
||||
isActive: group.value.isActive,
|
||||
isPartlyActive: group.value.isPartlyActive,
|
||||
),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
onTap: () async {
|
||||
await WebEngineHardeningGroupRoute(
|
||||
group: group.key,
|
||||
).push(context);
|
||||
},
|
||||
),
|
||||
children: data.entries.map((group) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ListTile(
|
||||
title: Text(group.key),
|
||||
subtitle: group.value.description.mapNotNull(
|
||||
(description) => Text(description),
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
leading: HardeningGroupIcon(
|
||||
isActive: group.value.isActive,
|
||||
isPartlyActive: group.value.isPartlyActive,
|
||||
),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
onTap: () async {
|
||||
await WebEngineHardeningGroupRoute(
|
||||
group: group.key,
|
||||
).push(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
error:
|
||||
(error, stackTrace) => FailureWidget(
|
||||
title: 'Could not load preference settings',
|
||||
exception: error,
|
||||
onRetry:
|
||||
() => ref.refresh(
|
||||
unifiedPreferenceSettingsRepositoryProvider(
|
||||
PreferencePartition.user,
|
||||
),
|
||||
),
|
||||
error: (error, stackTrace) => FailureWidget(
|
||||
title: 'Could not load preference settings',
|
||||
exception: error,
|
||||
onRetry: () => ref.refresh(
|
||||
unifiedPreferenceSettingsRepositoryProvider(
|
||||
PreferencePartition.user,
|
||||
),
|
||||
),
|
||||
),
|
||||
loading: () => const SizedBox.shrink(),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -70,84 +70,71 @@ class WebEngineHardeningGroupScreen extends HookConsumerWidget {
|
||||
),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children:
|
||||
group.settings.entries.map((setting) {
|
||||
return Row(
|
||||
children: [
|
||||
if (!setting.value.shouldBeDefault ||
|
||||
!setting.value.isActive)
|
||||
Expanded(
|
||||
child: SwitchListTile(
|
||||
value: setting.value.isActive,
|
||||
title: Text(
|
||||
setting.value.title ?? setting.key,
|
||||
),
|
||||
subtitle: setting.value.description
|
||||
.mapNotNull(
|
||||
(description) => Text(description),
|
||||
),
|
||||
secondary: HardeningGroupIcon(
|
||||
isActive: setting.value.isActive,
|
||||
),
|
||||
onChanged: (value) async {
|
||||
final notifier = ref.read(
|
||||
preferenceSettingsGroupRepositoryProvider(
|
||||
PreferencePartition.user,
|
||||
groupName,
|
||||
).notifier,
|
||||
);
|
||||
|
||||
if (value) {
|
||||
await notifier.apply(
|
||||
filter: [setting.key],
|
||||
);
|
||||
} else {
|
||||
await notifier.reset(
|
||||
filter: [setting.key],
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
else
|
||||
Expanded(
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
setting.value.title ?? setting.key,
|
||||
),
|
||||
subtitle: setting.value.description
|
||||
.mapNotNull(
|
||||
(description) => Text(description),
|
||||
),
|
||||
leading: HardeningGroupIcon(
|
||||
isActive: setting.value.isActive,
|
||||
),
|
||||
trailing: const Padding(
|
||||
padding: EdgeInsets.only(right: 18.0),
|
||||
child: Icon(Icons.check),
|
||||
),
|
||||
),
|
||||
children: group.settings.entries.map((setting) {
|
||||
return Row(
|
||||
children: [
|
||||
if (!setting.value.shouldBeDefault ||
|
||||
!setting.value.isActive)
|
||||
Expanded(
|
||||
child: SwitchListTile(
|
||||
value: setting.value.isActive,
|
||||
title: Text(setting.value.title ?? setting.key),
|
||||
subtitle: setting.value.description.mapNotNull(
|
||||
(description) => Text(description),
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
secondary: HardeningGroupIcon(
|
||||
isActive: setting.value.isActive,
|
||||
),
|
||||
onChanged: (value) async {
|
||||
final notifier = ref.read(
|
||||
preferenceSettingsGroupRepositoryProvider(
|
||||
PreferencePartition.user,
|
||||
groupName,
|
||||
).notifier,
|
||||
);
|
||||
|
||||
if (value) {
|
||||
await notifier.apply(filter: [setting.key]);
|
||||
} else {
|
||||
await notifier.reset(filter: [setting.key]);
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
else
|
||||
Expanded(
|
||||
child: ListTile(
|
||||
title: Text(setting.value.title ?? setting.key),
|
||||
subtitle: setting.value.description.mapNotNull(
|
||||
(description) => Text(description),
|
||||
),
|
||||
leading: HardeningGroupIcon(
|
||||
isActive: setting.value.isActive,
|
||||
),
|
||||
trailing: const Padding(
|
||||
padding: EdgeInsets.only(right: 18.0),
|
||||
child: Icon(Icons.check),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
error:
|
||||
(error, stackTrace) => FailureWidget(
|
||||
title: 'Could not load preference settings',
|
||||
exception: error,
|
||||
onRetry:
|
||||
() => ref.refresh(
|
||||
preferenceSettingsGroupRepositoryProvider(
|
||||
PreferencePartition.user,
|
||||
groupName,
|
||||
),
|
||||
),
|
||||
error: (error, stackTrace) => FailureWidget(
|
||||
title: 'Could not load preference settings',
|
||||
exception: error,
|
||||
onRetry: () => ref.refresh(
|
||||
preferenceSettingsGroupRepositoryProvider(
|
||||
PreferencePartition.user,
|
||||
groupName,
|
||||
),
|
||||
),
|
||||
),
|
||||
loading: () => const SizedBox.shrink(),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -46,12 +46,13 @@ class WebEngineSettingsScreen extends HookConsumerWidget {
|
||||
await ref
|
||||
.read(saveGeneralSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) =>
|
||||
value
|
||||
? currentSettings.copyWith
|
||||
.deleteBrowsingDataOnQuit({})
|
||||
: currentSettings.copyWith
|
||||
.deleteBrowsingDataOnQuit(null),
|
||||
(currentSettings) => value
|
||||
? currentSettings.copyWith.deleteBrowsingDataOnQuit(
|
||||
{},
|
||||
)
|
||||
: currentSettings.copyWith.deleteBrowsingDataOnQuit(
|
||||
null,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -325,27 +326,26 @@ class WebEngineSettingsScreen extends HookConsumerWidget {
|
||||
if (context.mounted) {
|
||||
final restart = await showDialog<bool>(
|
||||
context: context,
|
||||
builder:
|
||||
(context) => AlertDialog(
|
||||
title: const Text('User Agent Changed'),
|
||||
content: const Text(
|
||||
'The app needs to restart for the new user agent to take effect',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.pop(false);
|
||||
},
|
||||
child: const Text('Later'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.pop(true);
|
||||
},
|
||||
child: const Text('Restart Now'),
|
||||
),
|
||||
],
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('User Agent Changed'),
|
||||
content: const Text(
|
||||
'The app needs to restart for the new user agent to take effect',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.pop(false);
|
||||
},
|
||||
child: const Text('Later'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.pop(true);
|
||||
},
|
||||
child: const Text('Restart Now'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
if (restart == true) {
|
||||
|
||||
Reference in New Issue
Block a user