diff --git a/lib/widgets/editor.dart b/lib/widgets/editor.dart index 0be9bf4b..30c9df6e 100644 --- a/lib/widgets/editor.dart +++ b/lib/widgets/editor.dart @@ -10,6 +10,7 @@ import 'package:flutter_quill/models/documents/attribute.dart'; import 'package:flutter_quill/models/documents/document.dart'; import 'package:flutter_quill/models/documents/nodes/container.dart' as containerNode; +import 'package:flutter_quill/models/documents/nodes/embed.dart'; import 'package:flutter_quill/models/documents/nodes/leaf.dart'; import 'package:flutter_quill/models/documents/nodes/line.dart'; import 'package:flutter_quill/models/documents/nodes/node.dart'; @@ -332,6 +333,18 @@ class _QuillEditorSelectionGestureDetectorBuilder launchUrl(link); } } + if (getEditor().widget.readOnly && segment.value is BlockEmbed) { + BlockEmbed blockEmbed = segment.value as BlockEmbed; + if (blockEmbed.type == 'image') { + Navigator.push( + getEditor().context, + MaterialPageRoute( + builder: (context) => + ImageTapWrapper(imageProvider: NetworkImage(blockEmbed.data)), + ), + ); + } + } } void _launchUrl(String url) async {