add manual full cloud index refresh

This commit is contained in:
ngfchl
2026-07-18 22:38:54 +08:00
parent 432698d0f2
commit 52e331bd11
2 changed files with 33 additions and 0 deletions
+26
View File
@@ -75,6 +75,7 @@ class _SettingsDialogState extends ConsumerState<SettingsDialog> {
Widget build(BuildContext context) {
final cs = ShadTheme.of(context).colorScheme;
final themeState = ref.watch(themeProvider);
final mediaState = ref.watch(mediaLibraryProvider);
return ShadDialog(
title: const Text('设置'),
@@ -235,6 +236,31 @@ class _SettingsDialogState extends ConsumerState<SettingsDialog> {
),
),
),
_SettingsRow(
icon: Icons.refresh_rounded,
label: '全盘文件索引',
child: ShadButton.outline(
size: ShadButtonSize.sm,
onPressed: mediaState.isRefreshingCloudIndex
? null
: () => ref
.read(mediaLibraryProvider.notifier)
.refreshGlobalCloudIndex(force: true),
leading: mediaState.isRefreshingCloudIndex
? SizedBox(
width: 14,
height: 14,
child: CircularProgressIndicator(
strokeWidth: 2,
color: cs.primary,
),
)
: const Icon(Icons.refresh_rounded, size: 15),
child: Text(
mediaState.isRefreshingCloudIndex ? '刷新中' : '立即刷新',
),
),
),
_SettingsRow(
icon: Icons.format_list_numbered_rounded,
label: '默认分页大小',