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