run dart format
This commit is contained in:
+1
-3
@@ -588,9 +588,7 @@ class _PinTopSiteTile extends HookConsumerWidget {
|
||||
|
||||
final isPinned = useCachedFuture(
|
||||
() => url != null
|
||||
? ref
|
||||
.read(topSiteRepositoryProvider.notifier)
|
||||
.isPinnedTopSiteUrl(url)
|
||||
? ref.read(topSiteRepositoryProvider.notifier).isPinnedTopSiteUrl(url)
|
||||
: Future.value(false),
|
||||
[url],
|
||||
);
|
||||
|
||||
+6
-8
@@ -27,10 +27,8 @@ Future<({String title, Uri url})?> showEditTopSiteDialog(
|
||||
}) {
|
||||
return showDialog<({String title, Uri url})>(
|
||||
context: context,
|
||||
builder: (context) => _EditTopSiteDialog(
|
||||
initialTitle: initialTitle,
|
||||
initialUrl: initialUrl,
|
||||
),
|
||||
builder: (context) =>
|
||||
_EditTopSiteDialog(initialTitle: initialTitle, initialUrl: initialUrl),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -121,10 +119,10 @@ class _EditTopSiteDialogState extends State<_EditTopSiteDialog> {
|
||||
eagerParsing: true,
|
||||
);
|
||||
if (url == null) return;
|
||||
Navigator.pop(
|
||||
context,
|
||||
(title: _titleController.text.trim(), url: url),
|
||||
);
|
||||
Navigator.pop(context, (
|
||||
title: _titleController.text.trim(),
|
||||
url: url,
|
||||
));
|
||||
}
|
||||
},
|
||||
child: const Text('Save'),
|
||||
|
||||
+1
-4
@@ -596,10 +596,7 @@ Future<void> _editItem(
|
||||
// If the item has no ID (unpersisted default), persist it first
|
||||
var id = item.id;
|
||||
if (id == null && item.isDefault) {
|
||||
id = await repo.ensureDefaultPersisted(
|
||||
title: item.title,
|
||||
url: item.url,
|
||||
);
|
||||
id = await repo.ensureDefaultPersisted(title: item.title, url: item.url);
|
||||
}
|
||||
if (id == null) return;
|
||||
|
||||
|
||||
+3
-6
@@ -46,9 +46,8 @@ class SearchModuleReorderView extends ConsumerWidget {
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => ref
|
||||
.read(searchReorderModeProvider.notifier)
|
||||
.deactivate(),
|
||||
onPressed: () =>
|
||||
ref.read(searchReorderModeProvider.notifier).deactivate(),
|
||||
child: const Text('Done'),
|
||||
),
|
||||
],
|
||||
@@ -70,9 +69,7 @@ class SearchModuleReorderView extends ConsumerWidget {
|
||||
child: ListTile(
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
entry.visible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
entry.visible ? Icons.visibility : Icons.visibility_off,
|
||||
color: entry.visible
|
||||
? colorScheme.primary
|
||||
: colorScheme.onSurfaceVariant,
|
||||
|
||||
+2
-5
@@ -64,11 +64,8 @@ class SearchModuleSection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final moduleOrder = ref.watch(
|
||||
searchModuleOrderProvider(moduleType.group),
|
||||
);
|
||||
final isVisible = moduleOrder
|
||||
.any((e) => e.type == moduleType && e.visible);
|
||||
final moduleOrder = ref.watch(searchModuleOrderProvider(moduleType.group));
|
||||
final isVisible = moduleOrder.any((e) => e.type == moduleType && e.visible);
|
||||
if (!isVisible) {
|
||||
return MultiSliver(children: const []);
|
||||
}
|
||||
|
||||
@@ -67,11 +67,7 @@ class TopSiteDao extends DatabaseAccessor<TopSiteDatabase>
|
||||
);
|
||||
}
|
||||
|
||||
Future<int> updateSite(
|
||||
String id, {
|
||||
required String title,
|
||||
required Uri url,
|
||||
}) {
|
||||
Future<int> updateSite(String id, {required String title, required Uri url}) {
|
||||
return (db.topSite.update()..where((t) => t.id.equals(id))).write(
|
||||
TopSiteCompanion(title: Value(title), url: Value(url.normalized)),
|
||||
);
|
||||
|
||||
@@ -544,8 +544,7 @@ class _FontSizeFactorSlider extends HookConsumerWidget {
|
||||
onChangeEnd: automaticFontSizeAdjustment
|
||||
? null
|
||||
: (value) async {
|
||||
final rounded =
|
||||
(value * 10).round() / 10;
|
||||
final rounded = (value * 10).round() / 10;
|
||||
sliderValue.value = rounded;
|
||||
await ref
|
||||
.read(
|
||||
|
||||
@@ -873,17 +873,14 @@ class _LnaEnabledTile extends HookConsumerWidget {
|
||||
|
||||
return SwitchListTile.adaptive(
|
||||
title: const Text('Local Network Access'),
|
||||
subtitle: const Text(
|
||||
'Enable local network and device access blocking',
|
||||
),
|
||||
subtitle: const Text('Enable local network and device access blocking'),
|
||||
secondary: const Icon(MdiIcons.lanDisconnect),
|
||||
value: lnaEnabled ?? false,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(saveEngineSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) =>
|
||||
currentSettings.copyWith.lnaEnabled(value),
|
||||
(currentSettings) => currentSettings.copyWith.lnaEnabled(value),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
+2
-6
@@ -176,9 +176,7 @@ class GeckoEngineSettingsService {
|
||||
|
||||
// LNA Settings
|
||||
Future<void> lnaBlocking(bool? state) {
|
||||
return _api.updateRuntimeSettings(
|
||||
GeckoEngineSettings(lnaBlocking: state),
|
||||
);
|
||||
return _api.updateRuntimeSettings(GeckoEngineSettings(lnaBlocking: state));
|
||||
}
|
||||
|
||||
Future<void> lnaBlockTrackers(bool? state) {
|
||||
@@ -188,9 +186,7 @@ class GeckoEngineSettingsService {
|
||||
}
|
||||
|
||||
Future<void> lnaEnabled(bool? state) {
|
||||
return _api.updateRuntimeSettings(
|
||||
GeckoEngineSettings(lnaEnabled: state),
|
||||
);
|
||||
return _api.updateRuntimeSettings(GeckoEngineSettings(lnaEnabled: state));
|
||||
}
|
||||
|
||||
Future<void> setPullToRefreshEnabled(bool enabled) {
|
||||
|
||||
Reference in New Issue
Block a user