Support image tap to go to photo view

pull/13/head
singerdmx 4 years ago
parent 75448d2d70
commit 92a0579489
  1. 13
      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/document.dart';
import 'package:flutter_quill/models/documents/nodes/container.dart' import 'package:flutter_quill/models/documents/nodes/container.dart'
as containerNode; 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/leaf.dart';
import 'package:flutter_quill/models/documents/nodes/line.dart'; import 'package:flutter_quill/models/documents/nodes/line.dart';
import 'package:flutter_quill/models/documents/nodes/node.dart'; import 'package:flutter_quill/models/documents/nodes/node.dart';
@ -332,6 +333,18 @@ class _QuillEditorSelectionGestureDetectorBuilder
launchUrl(link); 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 { void _launchUrl(String url) async {

Loading…
Cancel
Save