From 955d7b3cb42794b7107e263cb863b62d6a6ea0b9 Mon Sep 17 00:00:00 2001 From: Sven Carstensen Date: Mon, 23 Feb 2026 11:47:01 +0100 Subject: [PATCH] Erweiterungen --- lib/popups/files_popup.dart | 40 +++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/lib/popups/files_popup.dart b/lib/popups/files_popup.dart index 27ef986..695bdab 100644 --- a/lib/popups/files_popup.dart +++ b/lib/popups/files_popup.dart @@ -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) {