💄 Add go to previous path action in path nav in file list
This commit is contained in:
@@ -374,13 +374,26 @@ class FileListView extends HookConsumerWidget {
|
|||||||
icon: Icon(
|
icon: Icon(
|
||||||
mode.value == FileListMode.unindexed
|
mode.value == FileListMode.unindexed
|
||||||
? Symbols.inventory_2
|
? Symbols.inventory_2
|
||||||
|
: currentPath.value != '/'
|
||||||
|
? Symbols.arrow_back
|
||||||
: Symbols.folder,
|
: Symbols.folder,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (mode.value == FileListMode.unindexed) {
|
if (mode.value == FileListMode.unindexed) {
|
||||||
mode.value = FileListMode.normal;
|
mode.value = FileListMode.normal;
|
||||||
}
|
|
||||||
currentPath.value = '/';
|
currentPath.value = '/';
|
||||||
|
} else {
|
||||||
|
final pathParts =
|
||||||
|
currentPath.value
|
||||||
|
.split('/')
|
||||||
|
.where((part) => part.isNotEmpty)
|
||||||
|
.toList();
|
||||||
|
if (pathParts.isNotEmpty) {
|
||||||
|
pathParts.removeLast();
|
||||||
|
currentPath.value =
|
||||||
|
pathParts.isEmpty ? '/' : '/${pathParts.join('/')}';
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
visualDensity: const VisualDensity(
|
visualDensity: const VisualDensity(
|
||||||
horizontal: -4,
|
horizontal: -4,
|
||||||
|
|||||||
Reference in New Issue
Block a user