👔 Article wont show expand attachment list

This commit is contained in:
2024-10-19 16:55:14 +08:00
parent ac1b3fe15c
commit 0d807b8708
7 changed files with 125 additions and 27 deletions

View File

@ -33,12 +33,14 @@ class AttachmentEditorPopup extends StatefulWidget {
final List<String>? initialAttachments;
final void Function(String) onAdd;
final void Function(String) onRemove;
final void Function(String)? onInsert;
const AttachmentEditorPopup({
super.key,
required this.pool,
required this.onAdd,
required this.onRemove,
this.onInsert,
this.singleMode = false,
this.imageOnly = false,
this.autoUpload = false,
@ -557,6 +559,22 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
setState(() => _attachments.removeAt(idx));
},
),
if (widget.onInsert != null)
PopupMenuItem(
child: ListTile(
title: Text('insert'.tr),
leading: const Icon(Icons.insert_link),
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
),
),
onTap: () {
widget.onInsert!(
'![](solink://attachments/${element.rid})',
);
Navigator.pop(context);
},
),
],
),
],

View File

@ -287,6 +287,16 @@ class _AttachmentFullScreenState extends State<AttachmentFullScreen> {
'${widget.item.metadata?['width']}x${widget.item.metadata?['height']}',
style: metaTextStyle,
),
if (widget.item.metadata?['ratio'] != null)
Text(
(widget.item.metadata?['ratio'] as num)
.toStringAsFixed(2),
style: metaTextStyle,
),
Text(
widget.item.mimetype,
style: metaTextStyle,
),
],
),
),