Fix some known issues and add some new functions
Android APK Release / Build Android APK (push) Failing after 52m53s
Android APK Release / Build Android APK (push) Failing after 52m53s
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:lucide_icons/lucide_icons.dart';
|
||||
import '../../core/utils/file_utils.dart';
|
||||
|
||||
/// 面包屑导航组件
|
||||
class FileBreadcrumb extends StatelessWidget {
|
||||
@@ -14,7 +15,7 @@ class FileBreadcrumb extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final pathParts = currentPath.split('/');
|
||||
final pathParts = FileUtils.toRelativePath(currentPath).split('/');
|
||||
pathParts.removeWhere((part) => part.isEmpty);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = theme.colorScheme;
|
||||
@@ -54,7 +55,7 @@ class FileBreadcrumb extends StatelessWidget {
|
||||
),
|
||||
_buildBreadcrumbItem(
|
||||
context,
|
||||
name: _decodePathSegment(pathParts[i]),
|
||||
name: FileUtils.decodePathSegment(pathParts[i]),
|
||||
path: '/${pathParts.sublist(0, i + 1).join('/')}',
|
||||
icon: null,
|
||||
primaryColor: colorScheme.primary,
|
||||
@@ -68,22 +69,6 @@ class FileBreadcrumb extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
String _decodePathSegment(String value) {
|
||||
var decoded = value;
|
||||
|
||||
for (var i = 0; i < 5; i++) {
|
||||
try {
|
||||
final next = Uri.decodeComponent(decoded);
|
||||
if (next == decoded) break;
|
||||
decoded = next;
|
||||
} on FormatException {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return decoded;
|
||||
}
|
||||
|
||||
Widget _buildBreadcrumbItem(
|
||||
BuildContext context, {
|
||||
required String name,
|
||||
|
||||
Reference in New Issue
Block a user