Image attribute shows broken image icon when clicked

pull/22/head
singerdmx 4 years ago
parent 49b3b6acbd
commit 7837f98e12
  1. 7
      lib/widgets/editor.dart

@ -361,11 +361,14 @@ class _QuillEditorSelectionGestureDetectorBuilder
if (getEditor().widget.readOnly && segment.value is BlockEmbed) {
BlockEmbed blockEmbed = segment.value as BlockEmbed;
if (blockEmbed.type == 'image') {
final String imageUrl = blockEmbed.data;
Navigator.push(
getEditor().context,
MaterialPageRoute(
builder: (context) =>
ImageTapWrapper(imageProvider: NetworkImage(blockEmbed.data)),
builder: (context) => ImageTapWrapper(
imageProvider: imageUrl.startsWith('http')
? NetworkImage(imageUrl)
: AssetImage(imageUrl)),
),
);
}

Loading…
Cancel
Save