👽 Adopt the new folder system (w.i.p)
This commit is contained in:
@@ -13,8 +13,8 @@ import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
class FileInfoSheet extends StatelessWidget {
|
||||
final SnCloudFile item;
|
||||
|
||||
const FileInfoSheet({super.key, required this.item});
|
||||
final VoidCallback? onClose;
|
||||
const FileInfoSheet({super.key, required this.item, this.onClose});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -22,6 +22,7 @@ class FileInfoSheet extends StatelessWidget {
|
||||
final exifData = item.fileMeta?['exif'] as Map<String, dynamic>? ?? {};
|
||||
|
||||
return SheetScaffold(
|
||||
onClose: onClose,
|
||||
titleText: 'fileInfoTitle'.tr(),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
|
||||
@@ -8,6 +8,7 @@ class SheetScaffold extends StatelessWidget {
|
||||
final Widget child;
|
||||
final double heightFactor;
|
||||
final double? height;
|
||||
final VoidCallback? onClose;
|
||||
const SheetScaffold({
|
||||
super.key,
|
||||
this.title,
|
||||
@@ -16,6 +17,7 @@ class SheetScaffold extends StatelessWidget {
|
||||
this.actions = const [],
|
||||
this.heightFactor = 0.8,
|
||||
this.height,
|
||||
this.onClose,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -50,7 +52,11 @@ class SheetScaffold extends StatelessWidget {
|
||||
...actions,
|
||||
IconButton(
|
||||
icon: const Icon(Symbols.close),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
onPressed:
|
||||
() =>
|
||||
onClose != null
|
||||
? onClose?.call()
|
||||
: Navigator.pop(context),
|
||||
style: IconButton.styleFrom(minimumSize: const Size(36, 36)),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -160,7 +160,7 @@ class FileListView extends HookConsumerWidget {
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
folderItem.name,
|
||||
folderItem.folder.name,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -169,8 +169,8 @@ class FileListView extends HookConsumerWidget {
|
||||
// Navigate to folder
|
||||
final newPath =
|
||||
currentPath.value == '/'
|
||||
? '/${folderItem.name}'
|
||||
: '${currentPath.value}/${folderItem.name}';
|
||||
? '/${folderItem.folder.name}'
|
||||
: '${currentPath.value}/${folderItem.folder.name}';
|
||||
currentPath.value = newPath;
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user