Fix some known issues and add some new functions
Android APK Release / Build Android APK (push) Failing after 52m53s

This commit is contained in:
2026-05-25 20:03:59 +08:00
parent 74abb4a1c5
commit 39d8361080
8 changed files with 587 additions and 221 deletions
+41 -27
View File
@@ -6,6 +6,7 @@ import 'package:provider/provider.dart';
import '../../core/utils/date_utils.dart' as date_utils;
import '../../core/utils/file_icon_utils.dart';
import '../../core/utils/file_utils.dart';
import '../../data/models/file_model.dart';
import '../../services/file_service.dart';
import '../../services/storage_service.dart';
@@ -38,7 +39,8 @@ class SearchDialog extends StatefulWidget {
child: FadeTransition(opacity: fadeAnim, child: child),
);
},
pageBuilder: (context, animation, secondaryAnimation) => const SearchDialog(),
pageBuilder: (context, animation, secondaryAnimation) =>
const SearchDialog(),
);
}
@@ -145,8 +147,10 @@ class _SearchDialogState extends State<SearchDialog> {
// 在 async gap 之前获取所有引用
final navProvider = Provider.of<NavigationProvider>(context, listen: false);
final fileManager =
Provider.of<FileManagerProvider>(context, listen: false);
final fileManager = Provider.of<FileManagerProvider>(
context,
listen: false,
);
final parentPath = _extractParentPath(file.path);
final filePath = file.path;
@@ -286,16 +290,20 @@ class _SearchDialogState extends State<SearchDialog> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(LucideIcons.alertCircle,
size: 40, color: colorScheme.error.withValues(alpha: 0.7)),
Icon(
LucideIcons.alertCircle,
size: 40,
color: colorScheme.error.withValues(alpha: 0.7),
),
const SizedBox(height: 8),
Text(_errorMessage!,
style: TextStyle(color: theme.hintColor),
textAlign: TextAlign.center),
Text(
_errorMessage!,
style: TextStyle(color: theme.hintColor),
textAlign: TextAlign.center,
),
const SizedBox(height: 12),
FilledButton.tonal(
onPressed: () =>
_performSearch(_searchController.text.trim()),
onPressed: () => _performSearch(_searchController.text.trim()),
child: const Text('重试'),
),
],
@@ -316,12 +324,13 @@ class _SearchDialogState extends State<SearchDialog> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(LucideIcons.searchX,
size: 40,
color: theme.hintColor.withValues(alpha: 0.5)),
Icon(
LucideIcons.searchX,
size: 40,
color: theme.hintColor.withValues(alpha: 0.5),
),
const SizedBox(height: 8),
Text('未找到匹配文件',
style: TextStyle(color: theme.hintColor)),
Text('未找到匹配文件', style: TextStyle(color: theme.hintColor)),
],
),
),
@@ -330,8 +339,7 @@ class _SearchDialogState extends State<SearchDialog> {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 32),
child: Center(
child: Text('输入关键词搜索文件',
style: TextStyle(color: theme.hintColor)),
child: Text('输入关键词搜索文件', style: TextStyle(color: theme.hintColor)),
),
);
}
@@ -364,17 +372,21 @@ class _SearchDialogState extends State<SearchDialog> {
children: [
Icon(LucideIcons.history, size: 16, color: theme.hintColor),
const SizedBox(width: 6),
Text('搜索历史',
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: theme.hintColor)),
Text(
'搜索历史',
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: theme.hintColor,
),
),
const Spacer(),
GestureDetector(
onTap: _clearHistory,
child: Text('清除',
style:
TextStyle(fontSize: 12, color: colorScheme.primary)),
child: Text(
'清除',
style: TextStyle(fontSize: 12, color: colorScheme.primary),
),
),
],
),
@@ -416,13 +428,15 @@ class _SearchDialogState extends State<SearchDialog> {
Text(
file.name,
style: const TextStyle(
fontWeight: FontWeight.w500, fontSize: 14),
fontWeight: FontWeight.w500,
fontSize: 14,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 2),
Text(
Uri.decodeComponent(file.relativePath),
FileUtils.decodePathForDisplay(file.relativePath),
style: TextStyle(fontSize: 12, color: theme.hintColor),
maxLines: 1,
overflow: TextOverflow.ellipsis,