setting to control swipe to refresh

This commit is contained in:
Fabian Freund
2026-01-10 19:13:36 +01:00
parent e6e3201059
commit 81fb8f5221
14 changed files with 138 additions and 4 deletions
@@ -66,6 +66,7 @@ class GeneralSettingsScreen extends StatelessWidget {
_AutoHideTabBarTile(),
_BottomSheetTabViewTile(),
_TabBarSwipeBehaviorSection(),
_PullToRefreshTile(),
_IconCacheTile(),
],
);
@@ -840,6 +841,32 @@ class _TabBarSwipeBehaviorSection extends HookConsumerWidget {
}
}
class _PullToRefreshTile extends HookConsumerWidget {
const _PullToRefreshTile();
@override
Widget build(BuildContext context, WidgetRef ref) {
final pullToRefreshEnabled = ref.watch(
generalSettingsWithDefaultsProvider.select((s) => s.pullToRefreshEnabled),
);
return SwitchListTile.adaptive(
title: const Text('Pull to Refresh'),
subtitle: const Text('Swipe down on pages to reload them'),
secondary: const Icon(MdiIcons.gestureSwipeDown),
value: pullToRefreshEnabled,
onChanged: (value) async {
await ref
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.pullToRefreshEnabled(value),
);
},
);
}
}
class _IconCacheTile extends HookConsumerWidget {
const _IconCacheTile();