Erweiterungen
This commit is contained in:
1 parent
63d947960d
commit
955d7b3cb4
1 file changed
+23
-9
@@ -86,21 +86,35 @@ class _FileListItemState extends State<_FileListItem> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (widget.file.isPdf) {
|
if (widget.file.isPdf) {
|
||||||
Navigator.of(context).pop(); // Close the files dialog
|
// Show PDF in a dialog on top of the files dialog
|
||||||
|
await showDialog(
|
||||||
// Navigate to PDF viewer
|
context: context,
|
||||||
Navigator.of(context).push(
|
builder: (BuildContext context) {
|
||||||
MaterialPageRoute(
|
return Dialog(
|
||||||
builder: (context) => PdfViewerPage(
|
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,
|
pdfUrl: widget.file.url,
|
||||||
title: widget.file.name,
|
title: widget.file.name,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
} else if (widget.file.isImage) {
|
} else if (widget.file.isImage) {
|
||||||
Navigator.of(context).pop(); // Close the files dialog
|
// Show image in a dialog on top of the files dialog
|
||||||
|
|
||||||
// Show image in a dialog
|
|
||||||
await showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
|||||||
Reference in new issue
Block a user