样式更改前的备份

This commit is contained in:
DelLevin-Home
2026-03-08 12:48:06 +08:00
parent 0c63242ca0
commit bb7b2c0191
3 changed files with 74 additions and 19 deletions

View File

@@ -662,6 +662,7 @@ class _NoteFormPageState extends State<NoteFormPage> {
/// 构建图片项
Widget _buildImageItem(int index) {
return InkWell(
onTap: () => _showImagePreview(index),
onLongPress: () => _showDeleteImageDialog(index),
child: Container(
decoration: BoxDecoration(
@@ -675,6 +676,32 @@ class _NoteFormPageState extends State<NoteFormPage> {
);
}
/// 显示图片预览
void _showImagePreview(int index) {
showDialog(
context: context,
barrierDismissible: true,
builder: (context) => GestureDetector(
onTap: () => Navigator.pop(context),
child: Container(
color: Colors.black.withOpacity(0.9),
child: Center(
child: InteractiveViewer(
panEnabled: true,
boundaryMargin: const EdgeInsets.all(20),
minScale: 0.5,
maxScale: 4,
child: Image.file(
File(_images[index]),
fit: BoxFit.contain,
),
),
),
),
),
);
}
/// 显示删除图片确认对话框
void _showDeleteImageDialog(int index) {
showDialog(