custom pwa and shortcut support
This commit is contained in:
@@ -48,6 +48,7 @@ class BrowsingSettingsScreen extends StatelessWidget {
|
||||
children: const [
|
||||
_TabsSection(),
|
||||
_NavigationSection(),
|
||||
_HomeScreenSection(),
|
||||
_ExternalLinksSection(),
|
||||
],
|
||||
);
|
||||
@@ -665,6 +666,49 @@ class _DoubleBackCloseTabTile extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _HomeScreenSection extends StatelessWidget {
|
||||
const _HomeScreenSection();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Column(
|
||||
children: [
|
||||
SettingSection(name: 'Home Screen'),
|
||||
_AllowNonManifestPwaInstallTile(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _AllowNonManifestPwaInstallTile extends HookConsumerWidget {
|
||||
const _AllowNonManifestPwaInstallTile();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final allowNonManifestPwaInstall = ref.watch(
|
||||
generalSettingsWithDefaultsProvider
|
||||
.select((s) => s.allowNonManifestPwaInstall),
|
||||
);
|
||||
|
||||
return SwitchListTile.adaptive(
|
||||
title: const Text('Install Sites as Apps'),
|
||||
subtitle: const Text(
|
||||
'Allow installing websites without a PWA manifest as standalone apps',
|
||||
),
|
||||
secondary: const Icon(Icons.add_to_home_screen),
|
||||
value: allowNonManifestPwaInstall,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(saveGeneralSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) =>
|
||||
currentSettings.copyWith.allowNonManifestPwaInstall(value),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _UrlCleanerSettingsTile extends StatelessWidget {
|
||||
const _UrlCleanerSettingsTile();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user