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';
|
||||
|
||||
/// 面包屑导航组件
|
||||
@@ -15,7 +16,7 @@ class FileBreadcrumb extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final pathParts = FileUtils.toRelativePath(currentPath).split('/');
|
||||
final pathParts = currentPath.split('/');
|
||||
pathParts.removeWhere((part) => part.isEmpty);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = theme.colorScheme;
|
||||
@@ -55,7 +56,7 @@ class FileBreadcrumb extends StatelessWidget {
|
||||
),
|
||||
_buildBreadcrumbItem(
|
||||
context,
|
||||
name: FileUtils.decodePathSegment(pathParts[i]),
|
||||
name: _decodePathSegment(pathParts[i]),
|
||||
path: '/${pathParts.sublist(0, i + 1).join('/')}',
|
||||
icon: null,
|
||||
primaryColor: colorScheme.primary,
|
||||
@@ -69,6 +70,10 @@ class FileBreadcrumb extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
String _decodePathSegment(String value) {
|
||||
return FileUtils.safeDecodePathSegment(value);
|
||||
}
|
||||
|
||||
Widget _buildBreadcrumbItem(
|
||||
BuildContext context, {
|
||||
required String name,
|
||||
|
||||
Reference in New Issue
Block a user