merge new features

This commit is contained in:
2026-05-27 19:19:11 +08:00
parent 886046a72b
commit 98af110531
37 changed files with 6405 additions and 993 deletions
@@ -23,45 +23,26 @@ class QuickFunctionsSection extends StatelessWidget {
const QuickFunctionsSection({super.key});
static final _functions = [
_QuickFunction(
icon: LucideIcons.share2,
label: '我的分享',
route: RouteNames.share,
),
_QuickFunction(
icon: LucideIcons.cloud,
label: 'WebDAV',
route: RouteNames.webdav,
),
_QuickFunction(
icon: LucideIcons.download,
label: '离线下载',
route: RouteNames.remoteDownload,
),
_QuickFunction(
icon: LucideIcons.trash2,
label: '回收站',
route: RouteNames.recycleBin,
),
_QuickFunction(icon: LucideIcons.share2, label: '我的分享', route: RouteNames.share),
_QuickFunction(icon: LucideIcons.cloud, label: 'WebDAV', route: RouteNames.webdav),
_QuickFunction(icon: LucideIcons.download, label: '离线下载', route: RouteNames.remoteDownload),
_QuickFunction(icon: LucideIcons.trash2, label: '回收站', route: RouteNames.recycleBin),
_QuickFunction(
icon: LucideIcons.refreshCw,
label: '文件同步',
onTap: (ctx) {
final isMobilePlatform =
defaultTargetPlatform == TargetPlatform.android ||
defaultTargetPlatform == TargetPlatform.iOS;
if (isMobilePlatform) {
final nav = ctx.read<NavigationProvider>();
// 桌面端有同步 Tab(index 4),直接切换;移动端跳转同步设置页
final isDesktop = defaultTargetPlatform != TargetPlatform.android &&
defaultTargetPlatform != TargetPlatform.iOS;
if (isDesktop) {
nav.setIndex(4);
} else {
Navigator.of(ctx).pushNamed(RouteNames.syncSettings);
return;
}
ctx.read<NavigationProvider>().setIndex(3);
},
),
_QuickFunction(
icon: LucideIcons.settings,
label: '设置',
route: RouteNames.settings,
),
_QuickFunction(icon: LucideIcons.settings, label: '设置', route: RouteNames.settings),
];
static const double _spacing = 12;
@@ -82,12 +63,9 @@ class QuickFunctionsSection extends StatelessWidget {
children: [
Icon(LucideIcons.zap, size: 18, color: theme.colorScheme.primary),
const SizedBox(width: 8),
Text(
'快捷功能',
style: theme.textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w600,
),
),
Text('快捷功能',
style: theme.textTheme.titleMedium
?.copyWith(fontWeight: FontWeight.w600)),
],
),
),
@@ -101,8 +79,7 @@ class QuickFunctionsSection extends StatelessWidget {
if (itemWidth < _minItemWidth) break;
perRow = next;
}
final itemWidth =
(availableWidth - _spacing * (perRow - 1)) / perRow;
final itemWidth = (availableWidth - _spacing * (perRow - 1)) / perRow;
return Wrap(
spacing: _spacing,
@@ -155,7 +132,9 @@ class _QuickFunctionCardState extends State<_QuickFunctionCard> {
final colorScheme = theme.colorScheme;
return Card(
color: _hovered ? colorScheme.surfaceContainerHighest : null,
color: _hovered
? colorScheme.surfaceContainerHighest
: null,
child: InkWell(
onTap: widget.onTap,
borderRadius: BorderRadius.circular(12),