Erweiterungen

This commit is contained in:
Sven committed 2026-02-23 11:47:01 +01:00
1 parent 63d947960d
commit 955d7b3cb4
1 file changed
+27 -13
+27 -13
View File
@@ -86,21 +86,35 @@ class _FileListItemState extends State<_FileListItem> {
try {
if (widget.file.isPdf) {
Navigator.of(context).pop(); // Close the files dialog
// Navigate to PDF viewer
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => PdfViewerPage(
pdfUrl: widget.file.url,
title: widget.file.name,
),
),
// Show PDF in a dialog on top of the files dialog
await showDialog(
context: context,
builder: (BuildContext context) {
return Dialog(
insetPadding: const EdgeInsets.all(8),
child: Column(
children: [
AppBar(
title: Text(widget.file.name),
leading: IconButton(
icon: const Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
automaticallyImplyLeading: false,
),
Expanded(
child: PdfViewerPage(
pdfUrl: widget.file.url,
title: widget.file.name,
),
),
],
),
);
},
);
} else if (widget.file.isImage) {
Navigator.of(context).pop(); // Close the files dialog
// Show image in a dialog
// Show image in a dialog on top of the files dialog
await showDialog(
context: context,
builder: (BuildContext context) {