generated from dellevin/template
样式更改前的备份
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user