1.3.21.3.2
Android APK Release / Build Android APK (push) Successful in 55m29s

This commit is contained in:
2026-05-26 16:32:18 +08:00
parent 546cef5ba6
commit 17673b2862
89 changed files with 24098 additions and 272 deletions
+12 -26
View File
@@ -2,7 +2,6 @@ import 'package:cloudreve4_flutter/data/models/file_model.dart';
import 'package:cloudreve4_flutter/services/file_service.dart';
import 'package:flutter/material.dart';
import '../../core/utils/app_logger.dart';
import '../../core/utils/file_utils.dart';
/// 文件夹选择器
class FolderPicker extends StatefulWidget {
@@ -62,7 +61,7 @@ class _FolderPickerState extends State<FolderPicker> {
void _enterFolder(FileModel folder) {
setState(() {
_currentPath = folder.relativePath;
_currentPath = folder.path;
});
_loadFolders();
}
@@ -81,10 +80,7 @@ class _FolderPickerState extends State<FolderPicker> {
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: widget.maxVisibleItems != null
? (widget.maxVisibleItems! * 56.0 + 40.0).clamp(
80.0,
maxHeight,
)
? (widget.maxVisibleItems! * 56.0 + 40.0).clamp(80.0, maxHeight)
: maxHeight,
),
child: _buildListContent(context, primaryColor),
@@ -112,10 +108,7 @@ class _FolderPickerState extends State<FolderPicker> {
children: [
Icon(Icons.folder_off, size: 48, color: Colors.grey.shade400),
const SizedBox(height: 12),
Text(
'此文件夹为空',
style: TextStyle(color: Colors.grey.shade600, fontSize: 14),
),
Text('此文件夹为空', style: TextStyle(color: Colors.grey.shade600, fontSize: 14)),
],
),
);
@@ -153,13 +146,7 @@ class _FolderPickerState extends State<FolderPicker> {
),
const SizedBox(width: 12),
Expanded(
child: Text(
folder.name,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w500,
),
),
child: Text(folder.name, style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w500)),
),
Icon(Icons.chevron_right, color: Colors.grey.shade400, size: 20),
],
@@ -169,7 +156,7 @@ class _FolderPickerState extends State<FolderPicker> {
}
Widget _buildBreadcrumb(BuildContext context, Color primaryColor) {
final pathParts = FileUtils.toRelativePath(_currentPath).split('/');
final pathParts = _currentPath.split('/');
pathParts.removeWhere((part) => part.isEmpty);
return Column(
@@ -193,8 +180,8 @@ class _FolderPickerState extends State<FolderPicker> {
),
...pathParts.asMap().entries.expand((entry) {
final index = entry.key;
final path =
'/${pathParts.sublist(0, index + 1).join('/')}';
final part = entry.value;
final path = '/${pathParts.sublist(0, index + 1).join('/')}';
return [
Padding(
@@ -207,7 +194,7 @@ class _FolderPickerState extends State<FolderPicker> {
),
_buildBreadcrumbItem(
context,
name: FileUtils.decodePathSegment(entry.value),
name: part,
path: path,
isLast: index == pathParts.length - 1,
primaryColor: primaryColor,
@@ -221,14 +208,13 @@ class _FolderPickerState extends State<FolderPicker> {
const SizedBox(width: 12),
FilledButton.tonal(
onPressed: () {
final relative = FileUtils.toRelativePath(_currentPath);
final relative = _currentPath.startsWith('cloudreve://my')
? _currentPath.replaceFirst('cloudreve://my', '')
: _currentPath;
widget.onFolderSelected(relative.isEmpty ? '/' : relative);
},
style: FilledButton.styleFrom(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 8,
),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
),
child: const Text('选择'),
),